Figures

Academic-style figures with automatic numbering and captions

Figures provide a way to display images with captions and automatic numbering, following academic publishing conventions.

Basic Usage

Use the figure shortcode to add a captioned image:

{{ figure(src="/images/nightingale.jpg", caption="Florence Nightingale's polar area diagram") }}
Florence Nightingale's polar area diagram showing causes of mortality in the Crimean War
Florence Nightingale's polar area diagram showing causes of mortality in the Crimean War

The figure number is generated automatically using CSS counters—you don't need to manage numbers manually.

Multiple Figures

When you add multiple figures, they're numbered sequentially:

Charles Minard's map of Napoleon's Russian campaign
Charles Minard's map of Napoleon's Russian campaign
Anscombe's quartet: four datasets with identical statistical properties but different distributions
Anscombe's quartet: four datasets with identical statistical properties but different distributions

Notice how the numbering continues automatically: Figure 1, Figure 2, Figure 3.

Parameters

The figure shortcode accepts these parameters:

ParameterRequiredDescription
srcYesPath to the image file
captionNoCaption text (supports inline markdown)
altNoAlt text for accessibility (defaults to caption)
idNoCustom ID for cross-references (defaults to fig-{n})

Custom IDs for Cross-References

You can assign a custom ID to reference a figure later:

{{ figure(src="/images/minard.png", caption="Minard's famous visualization", id="fig-minard") }}

See [Figure 2](#fig-minard) for an example of narrative data visualization.

This creates an anchor you can link to from anywhere on the page. The link Figure 2 will scroll to the Minard figure above.

Captions with Markdown

Captions support inline markdown formatting:

The *gamma distribution* $\\Gamma(k, \\theta)$ for various shape parameters $k$
The gamma distribution $\Gamma(k, \theta)$ for various shape parameters $k$

You can use italics, bold, and even inline math in your captions.

Layout Behavior

Figures extend slightly into the sidenote margin on wide screens, giving images more room to breathe. On narrower viewports, they shrink to fit the content column.

Figures also push any floating sidenotes down to prevent overlap, similar to how code blocks and tables behave.