Documents are trees |
TeXmacs represents all texts by trees (for a fixed text, the corresponding tree is called the edit tree). The inner nodes of such a tree are labeled by standard operators of type tree_label (see Basic/Data/tree.gen.h). The labels of the leaves of the tree are strings, which are either invisible (such as lengths or macro definitions), or visible (the real text). TeXmacs trees can be written using different notations. For instance, the tree
represents the formula
x + y + frac (1, 2) + sqrt (y +
z)
|
and can also be written as
|
in
The meaning of the text and the way it is typeset essentially depends on
the current environment. The environment mainly consists of a hash table
which maps environment variables to their tree values. The current
language, the current font and the current color are examples of system
environment variables; new variables can be defined by the user. For
instance, the
|
represents the document fragment
Some blue text
|
The TeXmacs primitive with indicates a local change of an environment variable.
In the sequel, we will describe in more detail the different stardard TeXmacs operators and environment variables. It should be noticed that the TeXmacs data format is still subject to change. In the last section we will describe these changes. Usually, the changes will not be noticed by the user, since they are always accompanied by conversion programs which automatically update to the new format. However, they are sometimes important for developers, although most changes just concern the addition of new primitives.