Contents

Delimiters

Supported math delimiters, skipped contexts, and known limitations.

Supported delimiters§

DelimiterMode
$...$Inline
$$...$$Display
\(...\)Inline
\[...\]Display

The content between delimiters is passed to katex-rs without the delimiters.

Examples§

<p>Inline: \( E = mc^2 \)</p>

<div>
\[
a = +\sqrt{2}
\]
</div>

This page is itself an example: the math below was rendered by katex-render during the site build.

Rendered inline: E=mc2 E = mc^2

Rendered display: a=+2 a = +\sqrt{2}

Dollar inline: a2+b2=c2a^2 + b^2 = c^2

Dollar display: ∫01x2 dx=13 \int_0^1 x^2\,dx = \frac{1}{3}

Skipped contexts§

Math is not processed inside:

  • code
  • pre
  • script
  • style
  • textarea
  • option
  • svg
  • math
  • existing .katex or .katex-display markup

Escaped delimiters§

A backslash escapes the next character, so \$5 is not treated as the start of inline math.

Limitations§

  • Bare LaTeX environments such as \begin{equation}...\end{equation} are not detected as delimiters. Wrap them in \[...\] or $$...$$ if you need them rendered.
  • \label and \ref are not provided by KaTeX; use a renderer that supports equation references if you need them.
  • Inline dollar delimiters can match currency-like prose. Keep math pages opt-in and avoid paired dollar signs in ordinary text.
  • Only the delimiters listed above are recognized.