Mathematical typesetting (source code)

= Mathematical typesetting

\b[Mathematical typesetting] arranges symbolic expressions in two dimensions. It must coordinate <computer fonts>, <glyph positioning>, <typesetting boxes> and <text baselines> while preserving the expression's visible structure. A <typeset fraction> positions its components above and below a bar; <superscripts>, <subscripts>, <square roots> and <mathematical delimiters> impose other geometric relationships.<MATH - The Mathematical Typesetting Table by Microsoft>[Overview: hierarchical formulas, recursive layout and component boxes]{ref}

For example,
$$
\frac{x^2+1}{\sqrt{y}}
$$
contains a <superscript> inside the upper component and a <square root> inside the lower component. Their dimensions help determine the height of the complete <typeset fraction>. A larger expression may then require larger surrounding <mathematical delimiters>. Laying out the smallest parts first makes this a recursive geometric construction.

An <OpenType MATH table> supplies font-specific information such as placement constants and suitable <glyph> variants. The table supplies data for layout; different implementations can use those data in different algorithms. <TeX> and <LaTeX> provide established authoring systems for expressing such mathematical structure.<MATH - The Mathematical Typesetting Table by Microsoft>[Overview and MATH table structures: font data rather than a complete layout algorithm]{ref}