Built-in environment variables |
The way TeXmacs typesets documents is influenced by so called environment variables. The style-sheet language uses a so called environment (or context) to store both environment variables and macros. The environment variables are subdivided into two catagories: built-in variables and additional variables provided by style files. Built-in variables usually affect the layout, while additional variables mostly serve computational purposes. In the next sections of this chapter, we will describe all built-in environment variables.
A typical built-in environment variable is color.
The value of an environment variable may be changed
permanently using
Some colored text.
Some <with|color|dark
red|colored>
text.
Counters are typical environment variables defined in style-sheets.
A weirdly
numbered list...
<enumerate|<document|<item>A
weirdly|<assign|item-nr|3><item>numbered list...>>
The typesetting language uses dynamic scoping of
variables. That means that macros can access and modify variables in
their calling context. In the previous example, the
Each document comes with an initial environment with the initial values of environment values, i.e. their values just before we typeset the document. If an environment variable does not occur in the initial environment, then its initial value defaults to its value after typesetting the document style and possible additional packages. The initial environment before typesetting the style files and packages is built-in into the editor.
Some variables, like header and footer variables, must be set inside the document, their initial environment value is ignored. Generally, they should be set by header and sectioning markup.