Expand description
The atom engine: TeX’s eight atom classes, contextual Bin→Ord degradation, and the inter-atom spacing table.
Everything here is TeX’s published mathematics (The TeXbook, chapter 17 and appendix G): the spacing table is transcribed entry-for-entry from page 170, and the two degradation rules are appendix G’s rules 5 and 6. These tables are the normative contract the spacing fixtures lock.
Enums§
- Atom
Class - TeX’s eight atom classes.
- Pair
Spacing - One entry of the spacing table.
- Spacing
- The amount of glue between two adjacent atoms.
Constants§
- ATOM_
CLASSES - The eight classes in table order (the order of the spacing table’s rows and columns).
- SPACING_
TABLE - The inter-atom spacing table, exactly as published (The TeXbook,
p. 170). Rows are the left atom’s class, columns the right atom’s class,
both in
ATOM_CLASSESorder.
Functions§
- char_
class - The intrinsic atom class of a direct character in math mode, before any command mapping. Follows plain TeX’s mathcode assignments.
- classify_
list - Classify a horizontal list: every item’s effective atom class, with TeX’s Bin→Ord degradation rules applied (appendix G, rules 5, 6, and 7):
- intrinsic_
class - The intrinsic atom class a node contributes to its enclosing list, or
Nonefor non-atom items (spacing, ties, breaks, alignment tabs, and the style/color markers), which are transparent to both degradation and inter-atom spacing. - pair_
spacing - The raw table entry for a pair.
- spacing_
in_ style - The glue between two adjacent atoms in a given style, with the script suppression rule applied. Impossible pairs yield no space (the engine never produces them after degradation; tolerating them here keeps the function total for untrusted callers).