![]() |
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:
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.
Similar as new-theorem, but for remarks.
Similar as new-theorem, but for exercises.
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.
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:
The first argument env-name specifies the name for the environment (like “experiment”) and the second, display-name, the corresponding text (like “Experiment”). The third argument is the name of the counter group to which the new environment belongs. The last argument render 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. You may use this macro to define new environments based on counter-groups other than the standard five theorem-env, exercise-env, etc. 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.