Writing Math with LaTeX
Beacon typesets LaTeX at build time with KaTeX — no client-side JavaScript.
Table of Contents
Beacon supports LaTeX math. Equations are typeset at build time with KaTeX
(via Hugo’s transform.ToMath), so no JavaScript is shipped to readers — the
KaTeX stylesheet is only included on pages that actually contain math.
Inline math
Wrap inline expressions in \( and \). For example, the identity
holds, and the golden ratio is
.
Plain dollar signs are left alone, so writing about a $5 coffee or a $10 lunch is safe.
Display math
Use $$ … $$ (or \[ … \]) for display equations:
Aligned environments work too:
Wide equations scroll horizontally inside the card instead of overflowing on small screens:
Enabling it
Math is off by default. Turn it on by enabling Goldmark’s passthrough extension in your site config:
[markup.goldmark.extensions.passthrough]
enable = true
[markup.goldmark.extensions.passthrough.delimiters]
block = [['\[', '\]'], ['$$', '$$']]
inline = [['\(', '\)']]
Single-dollar inline delimiters ($…$) are deliberately not part of the
recommended setup, since they collide with ordinary prose about prices.




Comments