Environment primitives

The current environment both defines all style parameters which affect the typesetting process and all additional macros provided by the user and the current style. The primitives in this section are used to access and modify environment variables.

<assign|var|val>
(variable mutation)

This primitive sets the environment variable named var (string value) to the value of the val expression. This primitive is used to make non-scoped changes to the environment, like defining markup or increasing counters.

This primitive affects the evaluation process through value, provides, and macro definitions and the typesetting process through special typesetter variables.

Example 1. Enabling page breaking by style.

The page-medium is used to enable page breaking. Since only the initial environment value for this variable is effective, this assignation must occur in a style file, not within a document.

<assign|page-medium|paper>

Example 2. Setting the chapter counter.

The following snippet will cause the immediately following chapter to be number 3. This is useful to get the the numbering right in book style when working with projects and include.

<assign|chapter-nr|2>

The operand must be a literal string and is interpreted as a file name. The content of this file is typeset in place of the include tag, which must be placed in block context.

<with|var-1|val-1||var-n|val-n|body>
(variable scope)

This primitive temporarily sets the environment variables var-1 until var-n (in this order) to the evaluated values of val-1 until val-n and typesets body in this modified environment. All non-scoped change done with assign to var-1 until var-n within body are reverted at the end of the with.

This primitive is used extensively in style files to modify the typesetter environment. For example to locally set the text font, the paragraph style, or the mode for mathematics.

<value|var>
(variable value)

This primitive evaluates the current value of the environment variable var (literal string). This is useful to display counters and generally to implement environment-sensitive behavior.

This primitive is used extensively in style files to modify the typesetter environment. For example to locally set the text font, the paragraph style, or the mode for mathematics.

<provides|var>
(definition predicate)

This predicate evaluates to true if the environment variable var (string value) is defined, and to false otherwise.

That is useful for modular markup, like the session environments, to fall back to a default appearance when a required package is not used in the document.

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