Docs
← Back to site

Math Notation with KaTeX

2 min readUpdated November 21, 2026

Math notation can be written directly in your doc content using LaTeX syntax, and WP Super Docs renders it as properly typeset formulas using KaTeX.

Inline math#

Wrap a formula in single dollar signs for inline math, right in the middle of a sentence:

The area of a circle is $A = \pi r^2$, where $r$ is the radius.

Display math#

Inline math in a sentence and a display formula on its own line, typeset by KaTeX.

Wrap a formula in double dollar signs for display math, shown on its own centered line:

$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$

You can also use \(...\) for inline math and \[...\] for display math instead of dollar signs, if you prefer that style or need to avoid ambiguity with literal dollar signs elsewhere in the doc.

KaTeX ships with the plugin and loads from your own site, with no requests to outside servers.

Currency and dollar signs#

KaTeX only renders text between a matching pair of delimiters, so a lone price like “$5” stays plain text. KaTeX also only loads on a doc that contains something that looks like a formula, so a doc that just mentions prices is never touched.

The one case to watch: a doc that has math and also two prices in the same paragraph, like $5 or $29. The two dollar signs form a pair, and the text between them is read as a formula. Use \(...\) for the math in that doc, or keep the prices in separate paragraphs.

Code blocks are ignored#

Math delimiters inside code blocks and inline code are never touched. If a code sample happens to contain a $ character, it renders as-is rather than being interpreted as the start of a formula.

Full LaTeX syntax#

KaTeX supports the full range of standard LaTeX math syntax: fractions, summations, integrals, matrices, Greek letters, and so on. If you already know LaTeX, everything you’d expect works. The complete syntax reference lives at katex.org, since it’s a general-purpose math typesetting library, not something specific to WP Super Docs.

Performance#

Like Mermaid diagrams, KaTeX only loads on doc pages that actually contain math notation. Docs without any math aren’t affected.

Was this helpful?

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only