NNuartz

LaTeX

2026-03-01Updated 2026-03-192 min read·

Render inline and block math expressions using remark-math and rehype-katex.

nuartz renders LaTeX math expressions using remark-math and rehype-katex. Math is typeset at build time — no JavaScript required in the browser beyond the KaTeX CSS.

Inline math

Wrap an expression in single dollar signs $...$ for inline math.

The famous identity is $e^{i\pi} + 1 = 0$.

Renders as: The famous identity is eiπ+1=0e^{i\pi} + 1 = 0.

Another example: the energy-mass equivalence E=mc2E = mc^2 is perhaps the most recognisable equation in physics.

Block math

Wrap an expression in double dollar signs $$ on their own lines for a centred block.

$$
\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}
$$
ex2dx=π\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}

Aligned equations

Use the aligned environment for multi-line derivations:

(a+b)2=a2+2ab+b2(ab)2=a22ab+b2\begin{aligned} (a + b)^2 &= a^2 + 2ab + b^2 \\ (a - b)^2 &= a^2 - 2ab + b^2 \end{aligned}

Matrices

[100010001]\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}

Dollar signs in text

A lone $ followed by a space is safe and will not trigger math. Only $...$ (no spaces after opening / before closing $) is parsed as inline math.

I have $5 and you have $10.

Renders as: I have 5andyouhave5 and you have 10.

Tip

If you need a literal $ next to text without spaces, escape it with \$.

Supported functions

KaTeX supports a large subset of LaTeX. See the KaTeX supported functions reference for the full list.

Tip

For chemistry equations, KaTeX ships a mhchem extension. Enable it by importing katex/contrib/mhchem in the nuartz build configuration.

Linked from (3)