Description Displays a MathML formula.
Required Script <script async custom-element="amp-mathml" src=""></script>
Supported Layouts container
Examples amp-mathml.amp.html


This extension creates an iframe and renders a MathML formula.

Example: The Quadratic Formula

<amp-mathml layout="container" data-formula="\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]">

Example: Cauchy's Integral Formula

<amp-mathml layout="container" data-formula="\[f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz\]">

Example: Double angle formula for Cosines

<amp-mathml layout="container" data-formula="\[ \cos(θ+φ)=\cos(θ)\cos(φ)−\sin(θ)\sin(φ) \]">

Example: Inline formula

This is an example of a formula placed inline in the middle of a block of text. <amp-mathml layout="container" inline data-formula="\[ \cos(θ+φ) \]"></amp-mathml> This shows how the formula will fit inside a block of text and can be styled with CSS.


data-formula (required)

Specifies the formula to render.

inline (optional)

If specified, the component renders inline (inline-block in CSS).


See amp-mathml rules in the AMP validator specification.