Text and inline elements
Text lives in a text block: <p>, <h1>–<h6>, or <caption>. A block may
contain plain text, interpolations, inline elements and inline math.
<p>Neighbours are stored differently <a to="jin2026">Jin et al. (2026)</a>,
and the estimate <span font-style="italic">S</span><sub>i</sub> must be
recomputed.</p>
The text block
| Tag | Default size | Default leading |
|---|---|---|
p | 10 pt | 1.2 |
h1 | 17 pt | 1.15 |
h2 | 14 pt | 1.15 |
h3 | 12 pt | 1.15 |
h4 | 11 pt | 1.15 |
h5 | 10.5 pt | 1.15 |
h6 | 10 pt | 1.15 |
caption | 8.5 pt | 1.2 |
cell | 9 pt | 1.2 |
Sizes and leadings are overridden by the tag's attributes, then by a project default for that tag, then by the engine value above.
Block attributes
| Attribute | Value | Notes |
|---|---|---|
font-size | number | Points, always — ignores unit |
leading | number | Multiple of this tag's font size |
align | left, center/centre, right, justify | |
color | colour | Any sRGB colour, alpha included |
font-family | family name | Must be declared in font.faces |
font-weight | normal, bold, or 1–1000 | |
font-style | normal, italic, oblique | |
letter-spacing | number (points) or "0.08em" | An em value is relative to the text size |
indent | length | First-line offset |
hanging | length | Later-line offset |
space-before | length | Space above the block |
unit | mm (default), cm, in, pt, pc, px | Applies only to lengths written on this tag |
id | string | A link target and a place for label() |
indent and hanging are alternatives. Stating both is an error
(indent-hanging), not a precedence rule.
<p align="justify" indent={4}>The first line starts four millimetres in.</p>
<p hanging={4}>The first line is flush; later lines are offset.</p>
<p color="rgb(200 40 20 / 70%)" letter-spacing="0.04em">Warmer, and slightly open.</p>
Inline elements
| Tag | Effect |
|---|---|
<a to="id"> | Internal link; destination resolved after drawing |
<a href="url"> | External link |
<span> | Carries text attributes for a run |
<b>, <strong> | Weight 700 |
<i>, <em> | Italic |
<small> | 85% of the inherited size |
<mark> | Accepted, no appearance of its own |
<sup> | 70% size, raised by 0.33 em |
<sub> | 70% size, lowered by 0.33 em |
<footnote> | A raised marker and an entry in the page's note area |
$…$ | Inline math |
<span> accepts font-size, color, letter-spacing, font-family,
font-weight, font-style, offset and unit. offset raises or lowers the
run in the current unit.
<caption labelled-by="tab-time">Table {tables["tab-time"].label}. Measured <sup>1</sup> on one socket.</caption>
An attribute value is an expression. Expressions are literals, identifiers,
object and array literals, field access, indexing and calls to the core
functions — no operators. Write {12} or {config.size}, not {10 + 2}.
Lines, breaks and hyphenation
Line breaking is decided by compile with a greedy fit, never by the renderer.
Whitespace collapses; a line ends between words, never inside one unless
hyphenation supplies a break.
Hyphenation has two sources, both in config:
hyphenation.words— words with explicit break points, writtenhy-phen-ation(an array, or an object keyed by the word);hyphenation.auto— the embedded English (US) Knuth–Liang patterns.
A literal hyphen in a word is always a break point. A word with no break point stays whole; if it cannot fit, it is clipped and reported rather than split arbitrarily.
Justification grows the spaces between words. If a line's gaps must exceed
2.5× the natural space, the line is still set justified and reported as
loose-line:
warning[loose-line]: a justified line needs word gaps wider than the engine allows
--> paper.mtx:88:17
= help: shorten the measure or add the words to the hyphenation list
Colour
A colour is any of:
color="navy" // a named colour
color="#b23a24" // #rgb, #rrggbb or #rrggbbaa
color="rgb(178 58 36)" // components 0–255, or percentages
color="rgb(178 58 36 / 60%)" // with alpha
Named values: black, white, red, green, blue, navy, gray/grey,
silver, maroon, olive, teal, purple. An unparseable colour is ignored
rather than guessed.
Faces, not synthetic styles
<b> asks the family for weight 700 and <i> asks it for italic. The engine
draws the face that matches; it never synthesises a bold or a slant. If the
family has no such face, the request falls back to the nearest declared face.
Small caps are a face, not a switch. Name a face whose lowercase letters are
small capitals and select it with font-family; use letter-spacing for
tracking.
Text in the static dialect
compile lowers <p> and the inline sugar into <line> and <span>. A static
line has a fixed height, a space-before, an optional width, and one
<span> per run with an optional x. This is what render draws; it does no
line breaking of its own.