Math (LaTeX)
Write inline and block mathematical expressions with LaTeX syntax — fractions, matrices, summations, and Greek letters rendered with KaTeX in Hugo.
Ownable renders math expressions using KaTeX, a fast LaTeX math renderer.
Inline Math
Wrap expressions in single dollar signs:
The famous equation $E = mc^2$ relates energy and mass.The famous equation relates energy and mass.
Block Math
Use double dollar signs for display-mode equations:
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$Common Examples
Fractions & Roots
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$Matrices
$$
A = \begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}
$$Summation & Products
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
\qquad
\prod_{i=1}^{n} i = n!
$$Greek Letters
| Syntax | Output | Syntax | Output |
|---|---|---|---|
$\alpha$ | $\beta$ | ||
$\gamma$ | $\delta$ | ||
$\theta$ | $\lambda$ | ||
$\sigma$ | $\omega$ |
Configuration
Math rendering is auto-detected — if your page contains $...$ or $$...$$, KaTeX loads automatically.
To force-enable math rendering on a page, add to your front matter:
---
math: true
---For the full list of supported LaTeX commands, see the KaTeX documentation.
Was this page helpful?
Code Blocks
Add syntax-highlighted code blocks with line highlighting, filenames, diff output, and 100+ languages in Hugo Markdown.
Diagrams (Mermaid)
Create flowcharts, sequence diagrams, Gantt charts, pie charts, and class diagrams with Mermaid.js in Hugo Markdown.
From the makers of
© 2026 Lore Labs.