[Next] [Up] [Previous]
Next: Unambiguous document encodings Up: Macros introduce new Previous: Rendering instances of

Defining new environments in LaTeX

As outlined in s:high-level-models, the document model in LaTeX can be extended by defining new environments. Typically, a new environment is defined to achieve specific kinds of layout, e.g., for typesetting conjectures and lemmas. We treat such environment definitions as adding new objects to the document model. The approach used is very similar to handling user-defined macros, though somewhat simpler. Object new-environment is used as a base class for all user-defined environments. The principal difference between objects introduced by user-defined macros and user-defined environments is that new-environment objects can be labeled and later cross referenced. The Lisp macro define-new-environment does the necessary bookkeeping involved in tracking such cross-referenceable objects. These properties are provided by the class definition for object new-environment.

TV Raman
Thu Mar 9 20:10:41 EST 1995