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 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.A stretchy mathematical operator can adapt its extent to the surrounding mathematical layout. In MathML Core, an
mo element's stretchy property participates in this decision. A mathematical delimiter around a tall typeset fraction is a familiar example. Actual stretching also requires an applicable constraint and suitable computer font data.[ref]For an original example, use
<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo stretchy="true" minsize="2em" maxsize="3em">(</mo><mfrac><mi>x</mi><mn>2</mn></mfrac><mo stretchy="true" minsize="2em" maxsize="3em">)</mo></mrow></math>. The row places two mathematical delimiters around a typeset fraction with numerator and denominator 2.Suppose the positive block-axis target totals, already expressed at a common scale, are , and em. The stated size bounds adjust them to , and em, respectively. This is the target-size constraint step, not a prediction of exact rendered ink heights. The complete algorithm also handles ascent/descent and symmetry about the Math axis.[ref]
MathML Core by World Wide Web Consortium. §3.2.4.3: minsize/maxsize normalization and target-size adjustment
Suitable mathematical glyph variants or mathematical glyph assemblies can supply the extended form. Setting
stretchy="false" changes the operator's instruction without changing the fraction's two operands. Layout properties and font constructions therefore belong in a controlled comparison; enlarging every outline uniformly is not the definition of stretching.