Tufte Hugo

tufte.hugo is a theme for the Hugo static site generator that renders your Markdown into exactly the markup Tufte CSS expects: articles split into sections, sidenotes and margin notes,Footnotes written with the usual [^1] syntax become sidenotes automatically. margin and full-width figures, epigraphs, and the ET Book typeface.

Start with the port of the Tufte CSS demo page, then read the theme guide to set up your own site.

Math and Code

KaTeX at build time, Chroma in the stylesheet, no JavaScript

Mathematics and source code are both set apart from prose, and both deserve the same care. tufte.hugo renders the first with KaTeX and the second with Chroma, at build time: the published page contains only HTML and CSS.

Write inline math between single dollar signs or between \( and \). Euler’s identity eiπ+1=0e^{i\pi} + 1 = 0 sits in the line of text, as does the binomial sum ∑k=0n(nk)=2n\sum_{k=0}^{n} \binom{n}{k} = 2^n.Both delimiters are declared in the site configuration, under markup.goldmark.extensions.passthrough; Hugo does not merge [markup] from a theme. Greek letters such as α\alpha, β\beta and φ\varphi match the weight of the surrounding ET Book reasonably well.

Read more →

Footnotes and Sidenotes

Margin notes for asides, footnotes at the end of each section

A printed page can carry two kinds of note at once: short asides in the margin and longer notes at the foot of the page.Sidenotes are numbered 1, 2, 3 … by Tufte CSS’s counter. This page does the same. Its front matter sets footnoteplacement: section, so the real footnotes of each section are listed at the end of that section.

Read more →

Footnotes as Sidenotes

Write ordinary Markdown footnotes, read them in the margin

Footnotes are the most portable way to write a note in Markdown: every editor previews them, every converter understands them, and they survive a move to another blog engine.CommonMark has no footnotes, but GitHub, Pandoc, MultiMarkdown, Obsidian and Goldmark all accept the same [^label] syntax. Sidenotes are the better way to read a note. This theme lets you write the first and publish the second.

Hugo renders footnotes as a superscript link in the text and a numbered list at the end of the page.Footnotes come from Goldmark’s footnote extension, which Hugo enables by default. After Hugo has rendered the page, the theme rewrites that output: each reference becomes the label, checkbox and span.sidenote that Tufte CSS expects, the note text is moved next to its reference, and the list at the bottom is removed.

Read more →

Reading Notes

Quotations, alerts and a summary break

A few notes collected while rereading Tufte’s books, with a sidenote in the summary.Sidenotes in summaries are converted too, and keep unique identifiers on list pages. The text above the summary divider is what list pages show.

Read more →

Small Multiples

A post that keeps its footnotes at the end

Small multiples are series of small graphics that share the same scales and design, repeated across the values of one variable. Because everything but the data stays constant, the eye compares the panels instead of decoding each one.

This post sets footnotes: endnotes in its front matter, so its notes are listed at the bottom of the page, as Hugo renders them by default, instead of being moved into the margin.

Read more →