2026-09-02 Writing posts with LaTeX, code, and footnotes

This post exists to exercise the template: inline math, display math, code with highlighting, tables, blockquotes and footnotes.1 Replace it with something real.

Math

Inline math uses \(...\) or single dollars: the Fourier transform of a Gaussian \(e^{-\pi x^2}\) is itself, and Euler’s identity $e^{i\pi} + 1 = 0$ still holds.

Display math uses \[...\] or double dollars:

\[ \hat{f}(\xi) = \int_{-\infty}^{\infty} f(x)\, e^{-2\pi i x \xi}\, dx \] $$ \mathrm{sinc}(x) = \frac{\sin(\pi x)}{\pi x}, \qquad L(x) = \begin{cases} \mathrm{sinc}(x)\,\mathrm{sinc}(x/a) & |x| < a \\ 0 & \text{otherwise} \end{cases} $$

Rendering is done client-side by KaTeX, and only on posts with math: true in the front matter.2

Code

#include <stdint.h>

/* Branchless CRC-32C table step. */
static inline uint32_t crc32c_step(uint32_t crc, uint8_t byte) {
    crc ^= byte;
    for (int i = 0; i < 8; i++)
        crc = (crc >> 1) ^ (0x82F63B78u & -(crc & 1u));
    return crc;
}
def lanczos(x: float, a: int = 3) -> float:
    if x == 0:
        return 1.0
    if abs(x) >= a:
        return 0.0
    return sinc(x) * sinc(x / a)

Tables and quotes

MethodPassesCost
Nearest1none
Linear1low
Lánczos2medium

A blockquote, in case you need to quote a paper or a very wrong Hacker News comment.

Images

Put images in static/img/ and reference them as /img/name.png:

![caption](/img/diagram.png)

  1. Footnotes render at the end of the post, in a smaller face, above a rule. ↩︎

  2. Set mathEverywhere = true in hugo.toml if you would rather load KaTeX on every post. ↩︎