Skip to main content

Module atom

Module atom 

Source
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§

AtomClass
TeX’s eight atom classes.
PairSpacing
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_CLASSES order.

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 None for 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).