Skip to content
Edit this page
On this page

MathJax

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

1 min read

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.

esc
↑↓ Navigate ↵ Open esc Close