Defining new environments

The env-base d.t.d. contains high-level markup which can be used by the user to define new numbered environments for theorems, remarks, exercises and figures:

<new-theorem|env-name|display-name>

This meta-macro is used for defining new theorem-like environments. The first argument env-name specifies the name for the environment (like “experiment”) and display-name the corresponding text (like “Experiment”). When defining a new theorem-like environment like experiment, an unnumbered variant experiment* is automatically defined as well.

<new-remark|env-name|display-name>

Similar as new-theorem, but for remarks.

<new-exercise|env-name|display-name>

Similar as new-theorem, but for exercises.

<new-exercise|env-name|display-name>

Similar as new-theorem, but for figures. When defining a new type of figure, like “picture”, the new-figure macro defines both the inline environment small-picture and the block-environment big-picture, as well as the unnumbered variants small-picture* and big-picture*.

The theorem-like and remark-like environments belong to a common counter-group theorem-env. By default, we use American-style numbering (one common counter for all environments). When selecting the package number-europe, each environment uses its own counter. All exercises and figures use their own counter-group.

More generally, the std-env counter-group regroups the counters for all standard TeXmacs environments. Typically, all counters in this group are prefixed in a similar way (for instance by the number of the chapter). Figure ? shows how the hierarchical organization of this counter group.

Figure 1. Organization of the counters for the standard TeXmacs environments.

In addition to the standard theorem-like, remark-like, exercise-like and figure-like environments, other numbered textual environments may be defined using the new-env macro. These environments may be based on arbitrary counter-groups:

<new-env|group|env|env-name|display-name>

The first argument is the name of the counter group to which the new environment belongs. The second argument env is the name of a binary macro for rendering the environment. The arguments of the rendering macro are a name (like “Theorem 3.14”) and its body. The remaining arguments are similar as for new-theorem. For instance, in the standard style-sheets, new-theorem is defined by

<document|<assign|new-theorem|<macro|env|name|<new-env|env|name|theorem-env|render-theorem>>>>

We recall that you may add new counters or counter-groups to the theorem-env counter-group using the new-counter-group and add-to-counter-group macros, as described in the section about counters.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".