Skip to content
A fast, modern Sphinx theme with dark mode, full-text search, and Alpine.js interactivity. Star on GitHub ★

MathJax

Sphinx includes MathJax support by default. Combined with MyST’s dollarmath and amsmath extensions, you get full LaTeX math rendering.

Setup

No additional packages needed. Just enable the MyST extensions:

conf.py
myst_enable_extensions = [
    "dollarmath",    # $E = mc^2$ inline, $$...$$ display
    "amsmath",       # \begin{aligned}...\end{aligned}
]

Usage

Inline math: $f(x) = x^2 + 1$

Display math:

$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

Result:

Inline math: \(f(x) = x^2 + 1\)

Display math:

\[ \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} \]

See also

Math — labeled equations, multi-line systems, matrices, and symbol tables.