![]() |
Mathematical primitives | ![]() |
These primitives are used for producing large delimiters, like in the formula
Matching left and right delimiters are automatically sized so as contain the enclosed expression. Between matching left and right delimiters, the formula may contain an arbitrary number of middle delimiters, which are sized in a similar way. Contrary to TeX, the depth of a large delimiter is not necessarily equal to its height, so as to correctly render formulas like
The user may override the automatically determined size by specifying additional length parameters size or bottom and top. For instance,
f<left|(|-8mm|4mm>x<mid|||8mm>y<right|)|-4mm|8mm> |
is rendered as
The size may also be a number \(n\), in which case the \(n\)-th available size for the delimiter is taken. For instance,
g<left|(|0><left|(|1><left|(|2><left|(|3>z<right|)|3><right|)|2><right|)|1><right|)|0> |
is rendered as
These primitives are used for matching brackets around a body, which is the preferred representation of bracketed expressions in TeXmacs formulas. In the case of around, the brackets left and right keep their normal size; in the case of around*, they are rendered as large delimiters (as with left and right) which are automatically sized so as to fit the body. For instance, the formula \(f \left( \frac{1}{x} \right)\) is represented by f<around*|(|<frac|1|x>|)>. When the math-nesting-mode environment variable is not off (the default is off), nested brackets are colored according to their nesting level.
This primitive is the structured counterpart of big: it renders the big operator big-symbol (such as <sum>) and makes its scope body explicit, instead of closing it with an invisible <big|.>.
This primitive is used in order to produce big operators as in
The size of the operator depends on whether the formula is rendered in “display style” or not. Formulas in separate equations, like (?), are said to be rendered in display style, contrary to formulas which occur in the main text, like \(\sum_{i = 0}^{\infty} a_i z^i\). The user may use Format\(\rightarrow\)Display style to override the current settings.
Notice that the formula (?) is internally represented as
<big|sum><rsub|i=0><rsup|∞>a<rsub|i>*z<rsup|i><big|.> |
The invisible big operator <big|.> is used to indicate the end of the scope of <big|sum>.
The frac primitive is used in order to render fractions like \(\frac{x}{y}\). In display style, the numerator num and denominator den are rendered in the normal size, but display style is turned of when typesetting num and den. When the display style is turned of, then the arguments are rendered in script size. For instance, the content
<frac|1|a<rsub|0>+<frac|1|a<rsub|1>+<frac|1|a<rsub|2>+⋱>>> |
is rendered in display style as
The sqrt primitive is used in order to render square roots like \(\sqrt{x}\) or n-th roots like \(\sqrt[3]{x}\). The root symbol is automatically sized so as to encapsulate the content:
These primitives are used in order to attach a script to the preceding box in a horizontal concatenation (in the case of right scripts) or the next one (in the case of left scripts). When there is no such box, then the script is attached to an empty box. Moreover, when both a subscript and a superscript are specified on the same side, then they are merged together. For instance, the expression
<rsub|a><rsup|b>+<lsub|1><lsup|2>x<rsub|3><rsup|4>=y<rsub|1>+<lsub|c> |
is rendered as
When a right script is attached to an operator (or symbol) which accepts limits, then it is rendered below or above instead of beside the operator:
Scripts are rendered in a smaller font in non-display style. Nevertheless, in order to keep formulas readable, the size is not reduced below script-script-size.
Left and right primes are similar to left and right superscripts, except that they behave in a different way when being edited. For instance, when your cursor is behind the prime symbol in \(f'\) and you press backspace, then the prime is removed. If you are behind \(f^n\) and you press backspace several times, then you first enter the superscript, next remove \(n\) and finally remove the superscript. Notice also that prime-symbols is necessarily a string of concatenated prime symbols. For instance, \(f^{\prime \dagger}\) is represented by f<rprime|'†>.
The below and above tags are used to explicitly attach a script below or above a given content. Both can be mixed in order to produce content with both a script below and above:
can be produced using
<above|<below|xor|i=1>|∞> x<rsub|i> |
These primitives can be used in order to produce wide accents above or below some mathematical content. For instance \(\overline{x + y}\) corresponds to the markup <wide|x+y|¯>.
Renders an extensible arrow (such as <rightarrow>) whose width is adapted to the superscript sup and the optional subscript sub, which are placed above and below the arrow. For instance, <long-arrow|→|f> is rendered as \(\overset{f}{\nonconverted{rightarrow} >}\).
This primitive is mainly used for producing negated symbols or expressions, such as \(\not{\rightarrowtail}\) or \(\not{a}\).
This primitive is used to produce a tree with a given root and children child-1 until child-n. The primitive should be used recursively in order to produce trees. For instance,
corresponds to the markup
<tree|+|x|y|<tree|×|2|y|z>> |
In the future, we plan to provide further style parameters in order to control the rendering.
Typeset content as an atomic box, but let it behave, for the purpose of mathematical spacing, line breaking penalties and semantic analysis, as the (evaluated) syntax. For instance, <syntax|<with|color|red|+>|+> behaves like an infix plus. When syntax is a single character, its spacing and penalty properties are used for the rendering.
This zero-ary directive indicates that right scripts attached to the preceding item should be rendered as limits (below and above it) instead of beside it, like for operators such as \(\lim\). As for such operators, this only happens in display style.