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 eiπ+1=0e^{i\pi} + 1 = 0 holds, and the golden ratio is φ=1+521.618\varphi = \frac{1 + \sqrt{5}}{2} \approx 1.618.

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:

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

Aligned environments work too:

E=ρε0B=0×E=Bt×B=μ0J+μ0ε0Et \begin{aligned} \nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \\ \nabla \cdot \mathbf{B} &= 0 \\ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\ \nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \end{aligned}

Wide equations scroll horizontally inside the card instead of overflowing on small screens:

f(a)=12πiγf(z)zadz(nk)=n!k!(nk)!n=11n2=π26 f(a) = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z - a} \, dz \qquad \binom{n}{k} = \frac{n!}{k!(n-k)!} \qquad \sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}

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.