plasTeX 3.0 — A Python Framework for Processing LaTeX Documents

6.3.8 Environment Objects

class Environment()

The Environment class is a subclass of Macro. This is the class that should be subclassed when creating Python based macros that correspond to LaTeX environments. The main difference between the processing of Commands and Environments is that the invoke() method does special handling of the LaTeX document context, and the digest() method absorbs the output stream tokens that are encapsulated by the \begin and \end tokens.

For more information on the Environment class’ API, see the Macro class.