import { Registers } from '../public/core' ; import { Atom } from './atom' ; import { getDefaultRegisters } from './registers' ; /**
 * Apply typsetting rules to a mathlist.
 *
 * The glue of math Atoms is calculated based on the type ('ord', 'rel', etc...)
 * of the atoms around them.
 *
 * TeXBook, p. 170
 *
 * > In fact, TEX’s rules for spacing in formulas are fairly simple. A formula is
 * > converted to a math list as described at the end of Chapter 17, and the math
 * > list consists chiefly of “atoms” of eight basic types: Ord (ordinary),
 * > Op (large operator), Bin (binary operation), Rel (relation), Open (opening),
 * > Close (closing), Punct (punctuation), and Inner (a delimited subformula).
 * > Other kinds of atoms, which arise from commands like \overline or
 * > \mathaccent or \vcenter, etc., are all treated as type Ord; fractions are
 * > treated as type Inner.
 *
 * > The following table is used to determine the spacing between pair of adjacent
 * > atoms.
 *
 * In this table
 * - "3" = `\thinmuskip`
 * - "4" = `\medmuskip`
 * - "5" = `\thickmuskip`
 *
 */ function typesetRecursive ( atoms , _options ) { return atoms ; } export function typeset ( atoms , options ? ) { return typesetRecursive ( atoms , { registers : options ?. registers ? options . registers : getDefaultRegisters ( ) , } ) ; }