Mathematical typesetting style 2026-11-05
A 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.[ref]Compare two presentations of the same expression: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 . Actual percentages come from the computer font's mathematical font constants.[ref]
MathML Core by World Wide Web Consortium. §4.5: ScriptPercentScaleDown and ScriptScriptPercentScaleDown
MathML 2026-11-05
MathML is a markup language for mathematical notation, structure and content on the web. Its elements describe expressions within a document rather than reducing a formula to a flat character string. MathML Core specifies a subset suited to web browser implementation; the cited 24June2025 document is a Candidate Recommendation Snapshot.[ref]
MathML Core by World Wide Web Consortium. Abstract; Status of This Document
Consider the typeset fraction . A presentation encoding is
<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow><mn>2</mn></mfrac></math>. The mi, mo and mn elements identify a symbolic name, an operator and numbers. The mrow groups the numerator; the two children of mfrac provide the numerator and denominator.[ref]Grouping changes the represented expression. At , the intended fraction gives , whereas . This arithmetic illustrates the meaning assigned to the structure; MathML presentation markup does not itself execute the calculation. Maintaining a structured representation helps document tools manipulate a formula and lets layout follow its mathematical grouping.
MathML Core 2026-11-05
MathML Core is a browser-oriented subset of MathML with specified rules for mathematical presentation and layout. The pinned 24 June 2025 document is a Candidate Recommendation Snapshot. It defines a concrete target for implementation, rather than identifying the whole MathML language with one browser's output.[ref]
MathML Core by World Wide Web Consortium. Abstract; Status of This Document; §2.1 elements and attributes
For an original example, encode a typeset fraction surrounded by parentheses as
<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo stretchy="true">(</mo><mfrac><mi>x</mi><mn>2</mn></mfrac><mo stretchy="true">)</mo></mrow></math>. The row has three children: a left mathematical delimiter, the typeset fraction and a right mathematical delimiter. The fraction's children supply numerator and denominator 2.The parentheses are stretchy mathematical operators: their markup requests size-sensitive layout around the fraction. Core specifies operator stretching and row layout; mathematical glyph variants or mathematical glyph assemblies can supply suitable forms.[ref]
MathML Core by World Wide Web Consortium. §§3.2.4.3, 3.3.1.1 and3.3.2: operator layout, stretching and fractions
This illustrates why presenting a formula requires more than placing all its characters on one text baseline.Changing
stretchy="true" to stretchy="false" changes the layout instruction without changing the fraction's two operands. Exact dimensions also depend on the computer font and applicable layout properties. The markup supplies structure and presentation instructions; substituting a numerical value for and evaluating the quotient is a separate operation. Subscript 2026-11-05
A subscript is a component placed below the usual baseline of a base expression, commonly at a smaller size. It can label a term of a sequence, as in , or identify a matrix entry, as in . Its position does not by itself determine the mathematical meaning of the label.
In TeX,
x_i attaches a single-token subscript, while x_{i+1} groups a compound subscript. In MathML, msub supplies a base and subscript as separate children. Their layout uses baseline shifts and clearances rather than putting both components on the ordinary text baseline.[ref]MathML Core by World Wide Web Consortium. Subscripts and superscripts: msub child layout and shift calculations
For example, keeps together as one attached component. A mathematical typesetting style controls the treatment of the smaller expression. An OpenType MATH table can supply the font-specific placement data. This is why adding an underscore as an ordinary printed glyph would not reproduce the layout.
Superscript 2026-11-05
A superscript is a component raised relative to a base expression, commonly also reduced in size. An exponent in is one use. The superscript in can instead denote a derivative when that convention has been specified. The typographic position supports several meanings.
In TeX,
x^2 supplies one token as the superscript and x^{n+1} groups a longer expression. In MathML, msup lays out the base and superscript separately, with vertical placement and gap constraints.[ref]MathML Core by World Wide Web Consortium. Subscripts and superscripts: msup layout
For example, the base and raised expression inhave different local baselines. A mathematical typesetting style determines how the raised expression is presented. When subscripts and superscripts are both attached, their mutual clearance also matters; independently moving each one without considering the other could cause a collision. An OpenType MATH table provides font-specific data used for these choices.
Typeset fraction 2026-11-05
A typeset fraction is a two-dimensional layout that places one expression above another, commonly with a horizontal rule between them. The components are laid out as typesetting boxes before they are assembled. In MathML, an
mfrac element supplies the two components; mathematical typesetting style affects their presentation.[ref]For example,has a superscript in its upper component and a square root in its lower component. Their dimensions influence the space above and below the fraction rule. The expression's algebraic meaning and its geometry are related but distinct: the layout can contain arbitrary expressions, including ones whose values are not rational numbers.
A simple own box model makes the horizontal placement explicit. Suppose the component widths are and , and the layout adds a chosen side allowance . If both components are centred in widththeir left offsets are and . This is an illustrative centring model; real layouts also use vertical clearances, rule thickness and font data from an OpenType MATH table.