A maths block renders a LaTeX-notation mathematical expression as a standalone, centred element separated from the surrounding text. It is delimited by $$ on its own line above and below the expression. Block maths is used when an equation deserves its own visual emphasis rather than sitting within a sentence.
The quadratic formula gives the roots of any quadratic equation:
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$
where $a$, $b$, and $c$ are the coefficients of $ax^2 + bx + c = 0$.
The quadratic formula gives the roots of any quadratic equation:
$$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
where $a$, $b$, and $c$ are the coefficients of $ax^2 + bx + c = 0$.
Best Practice
- Surround the
$$delimiters with blank lines so the block is clearly separated from the surrounding prose. - Use block maths for equations that are the focus of explanation — derivations, definitions, and named formulae. Use inline maths for brief expressions within a sentence.
- Label important equations with a prose reference immediately before or after — block maths without context can be opaque to non-specialist readers.
Notes
Renderer Requirements
Like inline maths, block maths requires a maths-enabled renderer. The $$...$$ syntax is passed through to KaTeX or MathJax; plain Markdown renderers display it as literal text. See the Maths (Inline) page for notes on KaTeX vs MathJax and platform support.
Numbering Equations
Standard Markdown and most KaTeX/MathJax integrations do not automatically number equations. Pandoc and Quarto provide equation numbering via extended syntax:
$$
E = mc^2
$$ {#eq:energy}
Support depends on the renderer and output format.
Markdown Flavour Support
Not standardised; requires a maths-enabled renderer or extension.
Flavour Support Detail
| Flavour | Support | Notes |
|---|---|---|
| Original Markdown | No | Not defined in the original spec. |
| CommonMark | No | Not part of the CommonMark spec. |
| GitHub Flavored Markdown | Partial | Supported in .md files on GitHub since 2022 with $$...$$; not supported in older contexts. |
| Pandoc Markdown | Yes | Full LaTeX maths support; equation numbering available with extended syntax. |
Practical Examples
- Presenting a key formula in a science study note: Display the equation prominently so it stands apart from the surrounding explanation and is easy to find when reviewing.
Newton's second law relates force, mass, and acceleration:
$$
F = ma
$$
A larger mass requires proportionally more force to achieve the same acceleration.
Newton's second law relates force, mass, and acceleration:
$$ F = ma $$
A larger mass requires proportionally more force to achieve the same acceleration.
- Baking ratio reference in a recipe science post: Lay out the hydration formula as a centred block so readers can absorb it before the explanation that follows.
Hydration is expressed as a percentage of the flour weight:
$$
\text{Hydration} = \frac{\text{Water (g)}}{\text{Flour (g)}} \times 100
$$
A loaf made with 650g of water and 1000g of flour has a hydration of 65%.
Hydration is expressed as a percentage of the flour weight:
$$ \text{Hydration} = \frac{\text{Water (g)}}{\text{Flour (g)}} \times 100 $$
A loaf made with 650g of water and 1000g of flour has a hydration of 65%.
- Photography exposure triangle in a hobbyist guide: Show the relationship between aperture, shutter speed, and ISO as a formula before walking through each factor.
Correct exposure can be expressed as a balance of three factors:
$$
\text{Exposure} \propto \frac{\text{ISO} \times \text{Time}}{\text{Aperture}^2}
$$
Increasing ISO or lengthening the shutter time brightens the image; a wider aperture (lower f-number) also increases exposure.
Correct exposure can be expressed as a balance of three factors:
$$ \text{Exposure} \propto \frac{\text{ISO} \times \text{Time}}{\text{Aperture}^2} $$
Increasing ISO or lengthening the shutter time brightens the image; a wider aperture (lower f-number) also increases exposure.