Skip to content

Code blocks

Code uses standard Markdown — no Keystone-specific syntax. Fence a block and tag it with a language for syntax highlighting:

```python
def greet(name):
    return f"Hello, {name}"
```

Inline code uses backticks: `make publish`. Keystone highlights fenced blocks in every format that supports it (PDF and EPUB), using the theme you select below.

Syntax-highlighting themes

Set code-theme in pandoc.yaml to choose the palette. The default is tango:

code-theme: espresso

This controls both the token colors (keywords, strings, comments) and the code block's background — and, on dark themes, the foreground text color — so blocks look coordinated out of the box.

Available themes

Light (dark text on a light background — the usual choice for print):

Theme Look
tango Default. Soft off-white background, bright saturated keywords and strings (the GNOME Tango palette) — high-contrast and friendly.
pygments Off-white background, the familiar Python-docs look — blue keywords, green strings, restrained.
kate Pure-white background, crisp and minimal (KDE's Kate editor defaults).
monochrome Off-white background, no syntax colors — tokens distinguished by bold and italic only. The safe pick for black-and-white print, where color themes muddy into gray.
haddock Off-white background, muted low-saturation tones (Haskell's Haddock) — understated.

Dark (light text on a dark background — better on screen than in print):

Theme Look
espresso Warm dark-brown background with tan text — cozy, low glare.
zenburn Soft medium-gray background, muted low-contrast colors — easy on the eyes over long stretches.
breezedark Cool blue-gray background with light text (KDE Breeze Dark) — crisp and modern.

These are Pandoc's eight built-in themes; custom theme files aren't supported, so the built-ins render consistently across versions.

Descriptions only go so far — the surest way to choose is to see it. Set code-theme to a candidate and rebuild; builds are quick, so trying all eight takes a minute.