Assignments

All user defined TeXmacs macros and style variables are stored in the “current typesetting environment”. This environment associates a tree value to each string variable. Variables whose values are macros correspond to new primitives. The others are ordinary environment variables. The primitives for operating on the environment are available from SourceDefine.

You may permanently change the value of an environment variable using the assign primitive, as in the example

<assign|hi|<macro|Hi there!>>

You may also locally change the values of one or several environment variables using the with primitive:

<with|font-series|bold|color|red|Bold red text>

The value of an environment variable may be retrieved using the value primitive. This may for instance be used in order to increase a counter:

<assign|my-counter|<plus|my-counter|1>>

Finally, you may associate logical properties to environment variables using the drd-props primitive. This is explained in more detail in the section about macro primitives.

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".