Math & LaTeX
Render math expressions and equations with KaTeX and LaTeX syntax. Requires styling.latex set to true in docs.json.
Jamdesk renders LaTeX math with KaTeX.
Math support requires styling.latex: true in your docs.json file.
Enable Math Support
Add to your docs.json:
{
"styling": {
"latex": true
}
}Inline Math
Use single dollar signs for inline equations:
The Pythagorean theorem states that $a^2 + b^2 = c^2$.
Renders as: The Pythagorean theorem states that $a^2 + b^2 = c^2$.
Block Equations
Use double dollar signs for centered, display-style equations:
$$
E = mc^2
$$
Renders as:
$$ E = mc^2 $$
Complex Equations
KaTeX renders a wide range of LaTeX notation:
Fractions
$$
\frac{n!}{k!(n-k)!} = \binom{n}{k}
$$
Integrals
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$
Summations
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$
Matrices
$$
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
$$
Using the Latex Component
Use the <Latex> component directly for more control:
<Latex>E = mc^2</Latex>
For block/display mode:
<Latex block>
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
</Latex>
Code Blocks Are Protected
Dollar signs inside code blocks are not treated as math:
echo $HOME
export PRICE=$100
Supported Commands
KaTeX covers most common LaTeX math commands. The KaTeX documentation lists every supported function.
Test complex equations on KaTeX's demo page first.
