Delimiters
Supported math delimiters, skipped contexts, and known limitations.
Supported delimiters§
| Delimiter | Mode |
|---|---|
$...$ | 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:
Rendered display:
Dollar inline:
Dollar display:
Skipped contexts§
Math is not processed inside:
codeprescriptstyletextareaoptionsvgmath- existing
.katexor.katex-displaymarkup
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. \labeland\refare 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.