![]() |
General environment variables | ![]() |
This very important environment variable determines the current mode. There are four possible values: text (text mode), math (mathematical mode), prog (programming mode) and src (source mode). The behaviour of the editor (menus, keystrokes, typesetting, etc.) depends heavily on the mode. For example, the following code may be used in order to include a mathematical formula inside text:
The formula \(a^2 + b^2 = c^2\) is well known. |
The formula <math|a<rsup|2>+b<rsup|2>=c<rsup|2>> is well known. |
Some other environment variables (mainly the language and the font) also depend on the current mode (in this context, the source mode always behaves in a similar way as the text mode). During copy&paste and search&replace operations, TeXmacs tries to preserve the mode.
language\(:=\)english
math-language\(:=\)std-math
A second major environment variable is the current language. In fact, there are three such environment variables: one for each mode. The language in which content is written is responsible for associating a precise semantics to the content. This semantics is used for different purposes:
The language may specify rules for typesetting content. For instance, the text language specifies punctuation and hyphenation rules. Similarly the mathematical language contains spacing information for mathematical operators.
Several editing operations depend on the current language: when performing a search or replace operation, TeXmacs is both mode and language sensitive. Similarly, the text language determines the dictionary to use when spell-checking the document.
The language controls (among other parameters like the mode and the document format) the way content is being converted from one context to another.
Currently, no real language-dependent conversions have been implemented yet. But in the future one may imagine that copying a piece of English text to a document written in French will perform an automatic translation. Similarly, a mathematical document might be converted from infix to postfix notation.
The programming language determines the current scripting language in use. Other scripting languages than Scheme are currently only used for interactive sessions, but primitives like extern might become language-sensitive in the future.
At the moment, the current language is mainly used as a hint for indicating the semantics of text: it is not required that a text written in English contains no spelling errors, or that a formula written in a mathematical language is mathematically or even syntactically correct. Nevertheless, the editor is intended to enforce correctness more and more, especially for mathematics.
The language may be specified globally for the whole document in Document\(\rightarrow\)Language and locally for a piece of text in Insert\(\rightarrow\)Language.
This environment variable is used in addition to the prog-language variable in order to determine a concrete implementation as well as a particular instance of the current programming language. For instance, in case of the Maxima language, different implementations may be used for the underlying Lisp. Similarly, one may wish to run two different instances of Maxima in parallel.
This variable determines the magnification which is applied to all content. Magnifications bigger than one are typically useful for presentations (from slides or from a laptop):
normal
big
huge
|
normal<htab|5mm><with|magnification|2|big><htab|5mm><with|magnification|3|huge> |
The magnification should not be confused with the font size: contrary to the magnification, the font size may also affect the shapes of the glyphs. The magnification is usually specified for the entire document in Document\(\rightarrow\)Magnification.
The background color for your document, as specified in Document\(\rightarrow\)Colors\(\rightarrow\)Background. Besides colors, the background may also be a pattern, a gradient or a picture; a pattern is made with the pattern primitive (see below). The background of a single page is page-this-bg-color, which may be a color or a pattern as well.
A color made from the image file, repeated as a tile of the given width and height (lengths, or percentages of the box which is painted, such as 100%, or 100@ for the size which keeps the proportions). It can be used wherever a color is expected: bg-color, page-this-bg-color, color, cell-background, decorated…
The optional argument effect is an effect which is applied to the image (recoloring, skin…), as done in the pattern selector. In old documents it may also be a color: it then only stands for the image when patterns are switched off (no-patterns), in themes for instance, and it is not used otherwise.
The optional argument base is a color which is painted, opaque, under the image, so that the transparent parts of the image show it and not what lies behind. It is chosen with Base color in the pattern selector. An empty effect ("" in the source) can be used when there is only a base color. The base color is painted on the screen as in print. Without base color, a pattern which is nested in the document (in a cell, in decorated…) is transparent. A pattern which makes the background of a page is painted on the paper: the background color bg-color of the document if it is a plain color, and the default of bg-color otherwise, so that a transparent image does not show what the screen held before, and looks as in the PDF.
Older versions of TeXmacs ignore the base argument, and the effect too when there is one.
The current foreground color of text and graphics, as specified in Document\(\rightarrow\)Colors\(\rightarrow\)Foreground or Format\(\rightarrow\)Color. Named colors, like “Salmon”, are supported for different color charts: dvips, x11 and html. Colors may also be specified in hexadecimal notation, like #f80 or #ff8000, possibly with an additional alpha channel, like #ff800080.
The opacity of the foreground color, specified either as a percentage or as a number between 0 and 1.
locus-color\(:=\)global
The colors used for rendering loci (like hyperlinks and references), resp. loci whose destination has already been visited. The value global means that the color is determined by the global user preferences, whereas the value preserve means that the current color is used.
This variable controls the horizontal spacing around mathematical operators and punctuation. Standard values are default, old and wide, as selected by the normal-spacing, old-spacing and wide-spacing macros. Style packages may also use more complex tuples as values.
The plug-in which is used for evaluating scripts inside the document (like executable fold or input fields), as specified in Document\(\rightarrow\)Scripts. The value none disables scripts.
This flag determines whether we are editing normal text or a style-sheet. The source tree or preamble mode may be selected in Document\(\rightarrow\)Source\(\rightarrow\)Edit source tree.
This variable controls the rendering of informative flags, which are for instance used to indicate the locations of otherwise invisible labels or typesetting directives. The info-flag may take the values none, minimal, short and detailed. The values paper and short-paper also render the flags when printing:
<with|info-flag|none|Label 1<label|flag-label-1>>, <with|info-flag|short|Label 2<label|flag-label-2>>, <with|info-flag|detailed|Label 3<label|flag-label-3>>. |
Usually, the rendering of informative flags is specified document-wide in Document\(\rightarrow\)Informative flags.