Math & LaTeX

Render mathematical equations with KaTeX

Jamdesk supports LaTeX for rendering mathematical expressions and equations using 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 supports 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

For more control, use the <Latex> component directly:

<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

This renders as normal code, not equations.

Supported Commands

KaTeX supports most common LaTeX math commands. See the KaTeX documentation for a complete list of supported functions.

For complex equations, test your LaTeX on KaTeX's demo page first.

Was this page helpful?