Customizing numbered textual environments |
TeXmacs provides three standard types of numbered textual environments: theorem-like environments, remark-like environments and exercise-like environments. The following aspects of these environments can be easily customized:
First of all, new environments can be added using the meta-macros
<new-theorem|experiment|Experiment>
When available in the TeXmacs dictionaries, the text “Experiment” will be automatically translated when your document is written in a foreign language. In the section about how to define new environments, it is also explained how to define other numbered textual environments (besides theorems, remarks and exercises).
The principal rendering of the environments can be customized by
redefining the
<assign|render-theorem|<macro|which|body|<document|<padded-normal|1fn|1fn|<surround|<theorem-name|which<theorem-sep>>||<with|font-shape|slanted|par-left|<plus|par-left|1.5fn>|body>>>>>>
This redefinition produces the following effect:
This is a theorem which has been typeset in a slanted font.
By default, the theorems are rendered as remarks with the only
difference that their bodies are typeset in an italic font. Hence,
redefining the
Instead of redefining the entire rendering, the user might just wish
to customize the way names of theorems are rendered or redefine the
separator between the name and the body. As the user may have noticed
by examining the above redefinition of
<assign|theorem-name|<macro|name|<with|color|dark
red|font-series|bold|name>>>
<assign|theorem-sep|<macro|: >>
Then theorem-like environments will be rendered as follows:
Proposition 2: This proposition is rendered in is a fancy way.
In the sections about counters and counter groups, it is
explained how to customize the counters of numbered environments for
particular purposes. For instance, by redefining
<\quasi|
<\assign|
inc-theorem
<macro|<compound|<unquote|inc-theorem>><reset-corollary>>
Notice the trick with
The following code from number-long-article.ts is used in order to prefix all standard environments with the number of the current section:
<assign|section-clean|<macro|<reset-subsection><reset-std-env>>>
<assign|display-std-env|<macro|nr|<section-prefix>nr>>