Variables

In addition to text and commands, TopLeaf offers the facility for storing content or values for later use. This is done through variables.

Variables are similar in appearance to commands/markers except that:

  • rather than causing an action, they store or contain content that may be referenced from with custom content;

  • A variable reference is declared by enclosing a variable name within a { and } bracket pair.

There are four types of variables:

Type Description Example
User Contain values or strings assigned using the <set/> command or <stack/> command. {MyVar}
Attribute Contain the value of an attribute defined within the current mapped tag or custom marker. {@date}
System Contain a runtime value or string generated by TopLeaf during typesetting. {toc-file}
Environment Contain the values of environment variables declared by the operating system. {$PATH}