Styling

The functions in this section represent a visual difference that is not usually material to the interpretation of an expression such as text color and size or other typographic variations.

Delimiter

["Delimiter", expr, delim]

Visually group arithmetic expressions.

When serializing to LaTeX, render expr wrapped in a delimiter.

delim is a string with the following format:

  • _"open"_ _"close"_ e.g. ["Delimiter", "x", "'()'"] renders as \( (x) \)
  • _"open"_ _"close"_ _"sep"_ e.g. ["Delimiter", ["List", 1, 2], "'{},'"] renders as \\lbrace (1, 2\rbrace \)

If expr is a ["List"] expression, serialize each element of the list, separated by sep.

If no sep is provided, use a comma , as a separator.

If no open and close strings are provided, use parentheses ( and ).

The Delimiter function is inert and the value of a ["Delimiter", _expr_] expression is expr.

Spacing

["Spacing", width]

When serializing to LaTeX, widthis the dimension of the spacing, in 1/18 em.

The Spacing function is inert and the value of a ["Spacing", _expr_] expression is expr.

Style

["Style", expr, dictionary]

  • expran expression
  • dictionarya dictionary with one or more of the following keys:
    • _"display"_:
      • "inline" for \textstyle
      • "block" for \displaystyle
      • "script" for \scriptstyle
      • "scriptscript" for \scriptscriptstyle
    • _"size"_: 110. Size 5 is normal, size 1 is smallest
    • _"color"_

The Style function is inert and the value of a ["Style", _expr_] expression is expr.