Skip to contentSkip to Content
ComponentsMath (LaTeX)

Math (LaTeX)

Inline and display math rendering via KaTeX . Use $ for inline expressions and $$ for centered display equations. Math support is enabled by default — no configuration needed.

API

Math uses Markdown syntax, not a JSX component:

SyntaxBehaviorDescription
$...$InlineRenders the expression inline with surrounding text.
$$...$$Display (block)Renders the expression as a centered block equation.

Math expressions inside code blocks (` or ```) are not rendered — they display as literal text, so you can safely document LaTeX syntax.

Example

Inline math

The Pythagorean theorem states that a2+b2=c2a^2 + b^2 = c^2 for a right triangle. Einstein’s famous equation E=mc2E = mc^2 relates energy and mass.

The Pythagorean theorem states that $a^2 + b^2 = c^2$ for a right triangle. Einstein's famous equation $E = mc^2$ relates energy and mass.

Display equations

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$

Matrices

[a11a12a21a22][x1x2]=[b1b2]\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} b_1 \\ b_2 \end{bmatrix}
$$ \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} b_1 \\ b_2 \end{bmatrix} $$

Summations

The binomial theorem:

(x+y)n=k=0n(nk)xnkyk(x + y)^n = \sum_{k=0}^{n} \binom{n}{k} x^{n-k} y^k
The binomial theorem: $$ (x + y)^n = \sum_{k=0}^{n} \binom{n}{k} x^{n-k} y^k $$