Home

Math

Math

Stencila Markdown supports inline and block mathematics. You can author math using TeX-style syntax, AsciiMath, or MathML, depending on what is most convenient for your workflow.

Inline math

Inline math is used when the expression should appear inside a paragraph.

TeX-style inline math

Use inline code with a math language tag for inline math:

A TeX equation `2 \pi r^2`{tex}.

A TeX equation 2πr2.

AsciiMath inline math

An AsciiMath equation `2 pi r^2`{asciimath}.

An AsciiMath equation 2𝜋r2.

MathML inline math

A MathML equation `<math><mrow><mn>2</mn><mi>π</mi><msup><mi>r</mi><mn>2</mn></msup></mrow></math>`{mathml}.

A MathML equation 2πr2.

Block math

Block math is used when the expression should stand on its own line.

TeX block math

When no language is specified, Stencila treats $$ ... $$ math blocks as TeX:

$$
2 \pi r^2
$$
2πr2
(1)

AsciiMath block math

```asciimath
2 pi r^2
```
2𝜋r2
(2)

MathML block math

```mathml
<math display="block"><mrow><mn>2</mn><mi>π</mi><msup><mi>r</mi><mn>2</mn></msup></mrow></math>
```
2πr2
(3)

Choosing a math format

  • Use TeX if you already write mathematics in LaTeX-style syntax.

  • Use AsciiMath if you prefer a lighter plain-text syntax.

  • Use MathML if you need an explicit XML representation of the math structure.

For most authoring workflows, TeX-style math is likely to be the most familiar option.

Related guides

For related authoring features, see:

Schema types

For the formal Stencila Schema definitions behind these features, see:

© 2026 Stencila