Mathematical typesetting style (source code)

= Mathematical typesetting style

A \b[mathematical typesetting style] selects layout conventions appropriate to a formula's context, including compact inline material and more spacious displayed material. In <MathML>, `math-style` distinguishes `normal` and `compact`, while `math-depth` participates in nested size selection.<MathML Core by World Wide Web Consortium>[§§4.3 and 4.5: math-style and math-depth]{ref}

Compare two presentations of the same expression:
$$
\displaystyle\frac{x+1}{y+1}\qquad\textstyle\frac{x+1}{y+1}.
$$
Both represent the same quotient, but reserve different vertical space. In <TeX>, `\displaystyle` and `\textstyle` request these contexts. The choice matters when fitting a <typeset fraction> into a line without making neighbouring <text baselines> unnecessarily far apart.

For a hypothetical <computer font> with first- and second-level script scales 80 and 60 percent, a base <font size> of 20 units gives script sizes 16 and 12. The second value is relative to the base, so it is not $0.8^2(20)=12.8$. Actual percentages come from the <computer font>'s <mathematical font constants>.<MathML Core by World Wide Web Consortium>[§4.5: ScriptPercentScaleDown and ScriptScriptPercentScaleDown]{ref}