Kurz gesagt
Eine Schulausgabe eines klassischen spanischen Romans in zwei Spalten. Sie zeigt, wie jede Anmerkung unten in der Spalte steht, die sie erwähnt, sodass niemand umblättern muss, um sie zu finden.
Was Sie setzen
Eine Schulausgabe des Lazarillo de Tormes, 210 × 280 mm in zwei Spalten aus der EB Garamond: der Prolog und der Anfang des ersten Traktats, in dem Lázaro in einer Mühle am Tormes geboren wird und mit einem Blinden in die Welt hinauszieht. Die Fußnoten erklären, was ein Leser von 1554 wusste und ein heutiger Leser nicht: das Dorf Tejares, den Feldzug zur Insel Los Gelves, den steinernen Stier auf der Brücke von Salamanca. Jede steht am Fuß der Spalte, die auf sie verweist, kleiner gesetzt unter einer kurzen ochsenblutroten Linie, sodass das Auge von der Ziffer zur Fußnote und zurück springt, ohne eine Seite umzublättern. Die englische Ausgabe enthält Clements Markhams eigene Anmerkungen aus seiner Übersetzung von 1908.
Dieses Rezept beantwortet
- Wie mache ich Fußnoten?
Die kurze Antwort
// In the Markdown: `Tejares,[^9]` cites a note (the id may be a word: `[^tejares]`), and
// a paragraph that opens with `[^9]:` anywhere in the chapter defines it. The engine
// numbers the notes in order of citation and keeps each note in the column of the line
// that cites it: a line whose note does not fit under it moves on with the note.
const footnotes = () => ({
placement: options.placement, // 'column' (the foot of the citing column) or 'chapterEnd'
numbering: options.numbering, // 'chapter': 1, 2, 3… again under every chapter heading
fontSize: pt(8.5), // off the baseline grid: the notes stack up from the column's foot
lineHeight: pt(10.5),
hangingIndent: em(0.9), // turnover lines align past the number
spaceBetween: pt(1.5),
separator: { width: 0.25, lineWidth: pt(0.5), color: col('oxblood') },
});
Zutaten
- Funktionen
- FußnotenHoch- und TiefstellungEine oder zwei SpaltenGestaltete AuftakteÜberschriftenattributeKolumnentitel und SeitenzahlenGespiegelte RänderKopfzeilen nach SeitenrolleAbsatzformateSemantische FarbpalettePapierfarbeWitwen, Waisen und kurze AusgangszeilenPDF-ExportBarrierefreies getaggtes PDF
- Schrift
- EB Garamond, Bodoni Moda, IBM Plex Sans Condensed (SIL OFL 1.1)
- Dateien
- Keine: Jedes Bild wird im Code gezeichnet
Zubereitung
#1 · Die Fußnote dort zitieren, wo sie hingehört, und sie irgendwo definieren
Die Konfiguration steht oben in der kurzen Antwort; der Rest ist Markdown. natives of Tejares,[^9] setzt eine hochgestellte Ziffer direkt am Komma, und ein Absatz, der mit [^9]: beginnt, enthält die Fußnote. Definitionen verlassen den Fluss, wo immer Sie sie schreiben, deshalb hält dieses Beispiel sie alle am Ende des Kapitels, so wie Markhams Anmerkungen in der Quelldatei standen. Die Nummern folgen der Reihenfolge der Verweise, sodass die Markdown-IDs Wörter sein können ([^tejares] in der spanischen Ausgabe) und das Neunummerieren eines Kapitels nie bedeutet, die Fußnoten zu bearbeiten.
#2 · Der Spalte Raum für ihre Fußnoten lassen
Bevor es eine Zeile setzt, rechnet das Layout die Höhe der Fußnoten hinzu, auf die diese Zeile zum ersten Mal verweist, und die Linie, wenn es die erste Fußnote der Spalte ist. Eine Zeile, deren Fußnote nicht mehr darunter passt, geht mit ihrem Absatz in die nächste Spalte, unter den Regeln für Witwen und Waisen, sodass eine Ziffer nie auf eine Fußnote in einer anderen Spalte zeigt. Die Fußnoten stapeln sich vom Fuß aufwärts in ihrem eigenen Grad und Zeilenabstand, außerhalb des Grundlinienrasters, während der Text darüber auf dem Raster bleibt; der Spaltenausgleich zählt nur den Text.
#3 · Jeden Auftakt auf dieselbe Zeile absenken
const opener = {
enabled: true,
// The sink holds a two-line title and its rule, with ~8 mm to the first line of text,
// so every chapter starts on the same grid line whatever its title's length.
minHeight: pt(LEAD * 10),
slot: { elements: [
{ kind: 'text', id: 'kicker', content: '{attr.kicker}', ...label, fontSize: pt(8.5),
letterSpacing: pt(1.8), color: col('oxblood'), align: 'center',
placement: at('container', 'top', 0, 7) },
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: 'Bodoni Moda', italic: true,
fontSize: pt(26), lineHeight: 1.1, color: col('ink'), align: 'center',
overflow: 'wrap', // design text ends in an ellipsis by default
placement: { ...at('container', 'top-left', 0, 13),
size: { width: 'fill', height: 'auto' } } },
{ kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(0.75), color: col('oxblood'),
placement: { anchor: { to: '#title', edge: 'below' }, // a rule starts at the box's left
offset: { x: mm((MEASURE - 14) / 2), y: mm(4.5) }, size: { width: mm(14) } } },
] },
};
Der Auftakt läuft über beide Spalten und zeichnet die Dachzeile des Kapitels aus dem Attribut kicker der Überschrift. minHeight reserviert zehn Rasterzeilen, genug für einen zweizeiligen Titel in der Bodoni und seine Linie, sodass der Text jedes Kapitels auf derselben Zeile beginnt und die Linie nie auf der ersten Textzeile steht.
#4 · Das Buch auf die linke Seite, das Kapitel auf die rechte
const head = (id, content, parity, edge, x, extra = {}) => ({
kind: 'text', id, content, parity, pages: 'body', // never on openers
...label, fontSize: pt(7.5), letterSpacing: pt(1.3), color: col('muted'),
placement: at('page', edge, x, 13), ...extra,
});
const folio = { color: col('oxblood') };
const header = { elements: [
head('verso-folio', '{pageNumber}', 'even', 'top-left', MARGIN.outer,
{ ...folio, align: 'left' }),
head('verso-title', '{title}', 'even', 'top-left', MARGIN.outer + 9, { align: 'left' }),
head('recto-title', '{chapterTitle}', 'odd', 'top-right', -(MARGIN.outer + 9),
{ align: 'right', overflow: 'ellipsis' }),
head('recto-folio', '{pageNumber}', 'odd', 'top-right', -MARGIN.outer,
{ ...folio, align: 'right' }),
] };
// Openers carry a drop folio instead, centred under the text block.
const footer = { elements: [{ ...head('drop-folio', '{pageNumber}', 'all', 'bottom', 0,
{ ...folio, align: 'center', placement: at('page', 'bottom', 0, -11) }), pages: 'opener' }] };
Die Kolumnentitel sind nach Parität an der Seite verankert, mit der Pagina am Außenrand; pages: 'body' hält sie von den Auftakten fern, die eine zentrierte Pagina am Fuß bekommen. Ein langer Kapiteltitel endet bei 120 mm mit Auslassungspunkten, statt in die Pagina zu laufen.
#5 · Die anderen Platzierungen ausprobieren
const CHOICES = {
columns: [[2, t({ en: 'Two columns', es: 'Dos columnas' })],
[1, t({ en: 'One column', es: 'Una columna' })]],
placement: [['column', t({ en: 'Column foot', es: 'Pie de columna' })],
['chapterEnd', t({ en: 'End of chapter', es: 'Final del capítulo' })]],
numbering: [['chapter', t({ en: 'Per chapter', es: 'Por capítulo' })],
['document', t({ en: 'Continuous', es: 'Continua' })]],
};
const bar = document.createElement('form');
bar.id = 'options';
bar.ariaLabel = t({ en: 'Footnote options', es: 'Opciones de las notas' });
for (const [key, choices] of Object.entries(CHOICES)) {
const group = bar.appendChild(document.createElement('fieldset'));
for (const [value, text] of choices) {
const input = Object.assign(document.createElement('input'), { type: 'radio', name: key,
value: String(value), checked: options[key] === value });
const item = group.appendChild(document.createElement('label'));
item.append(input, text);
}
}
bar.addEventListener('change', (event) => {
const { name, value } = event.target;
options[name] = name === 'columns' ? Number(value) : value;
config.layout = layoutFor(options.columns); // changed in place: the build sees it
config.footnotes = footnotes();
doc = buildDocument({ markdown }, config); // the fonts are loaded by now
showPages(doc, { title: TITLE });
});
document.getElementById('pages').before(bar);
Jeder Schalter setzt das Kapitel neu, mit einer geänderten Option. One column setzt die Fußnoten an den Fuß der Seite, die dort die Spalte ist. End of chapter setzt sie nach den letzten Absatz des Kapitels und lässt sie an den Fuß der Spalte sinken, die sie abschließen, unter derselben Linie. Continuous lässt die Nummern vom Prolog ins erste Kapitel weiterlaufen, statt wieder bei 1 zu beginnen.
Das ganze Rezept
// ═══ Postext Cookbook · Nº 071 · Footnotes at the foot of the column ══════════════
// https://postext.dev/en/cookbook/novel-footnotes-column-foot
// Code: MIT · Text: Lazarillo de Tormes (1554) and Markham's 1908 translation (PD)
// Fonts: EB Garamond, Bodoni Moda, IBM Plex Sans Condensed (SIL OFL 1.1) · Needs postext ≥ 1.25.0
import { buildDocument, buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'novel-footnotes-column-foot';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: oxblood for the kickers, the folios and the notes' rule; ink on warm paper
const palette = {
ink: '#241e1a', // text: a warm near-black
oxblood: '#7d2b1f', // the one accent
muted: '#6f655b', // running heads, colophon
rule: '#c9bdae', // hairlines
paper: '#fbf8f2',
};
// col(id): a colour linked to its palette entry, with the entry's hex beside the id.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
// The engine's defaults link to main-color: point it at the accent, never the default blue.
{ id: 'main-color', name: 'accent (defaults)', value: { hex: palette.oxblood, model: 'hex' } },
];
// #endregion
const TRIM = { width: 210, height: 280 }; // a school edition: two 82 mm columns
const MARGIN = { top: 23, bottom: 22, inner: 21, outer: 17 }; // mirrored
const MEASURE = TRIM.width - MARGIN.inner - MARGIN.outer; // 172 mm
const LEAD = 13.5; // body leading in pt: the baseline grid
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const label = { fontFamily: 'IBM Plex Sans Condensed', fontWeight: 600,
textTransform: 'uppercase' };
// The switches under the title change these and build again (#region live).
const options = { columns: 2, placement: 'column', numbering: 'chapter' };
const layoutFor = (columns) => (columns === 2
? { layoutType: 'double', gutterWidth: mm(7) } : { layoutType: 'single' });
// #region answer: the notes at the foot of the column that cites them
// In the Markdown: `Tejares,[^9]` cites a note (the id may be a word: `[^tejares]`), and
// a paragraph that opens with `[^9]:` anywhere in the chapter defines it. The engine
// numbers the notes in order of citation and keeps each note in the column of the line
// that cites it: a line whose note does not fit under it moves on with the note.
const footnotes = () => ({
placement: options.placement, // 'column' (the foot of the citing column) or 'chapterEnd'
numbering: options.numbering, // 'chapter': 1, 2, 3… again under every chapter heading
/* The option bar over the pages: three pairs of choices, each a segmented switch. */
#options {
display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px;
max-width: 1120px; margin: 0 auto; padding: 18px 16px 6px;
font: 600 12px/1.2 "IBM Plex Sans Condensed", system-ui, sans-serif;
letter-spacing: .06em; text-transform: uppercase;
}
#options fieldset {
display: flex; margin: 0; padding: 2px; border: 1px solid #4a433d; border-radius: 999px;
}
#options label {
display: block; padding: 7px 14px; border-radius: 999px; color: #c9bdae; cursor: pointer;
}
#options input { position: absolute; opacity: 0; pointer-events: none; }
#options label:has(input:checked) { background: #7d2b1f; color: #fbf8f2; }
#options label:has(input:focus-visible) { outline: 2px solid #c9bdae; outline-offset: 2px; }
Das zusammengesetzte script.js läuft unverändert: Fügen Sie es in das Modulskript einer beliebigen Seite ein, oder öffnen Sie das Rezept auf CodePen. Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)
Varianten
#Kapitelendnoten unter dem Text halten
Mit placement: 'chapterEnd' stehen die Fußnoten standardmäßig am Fuß der letzten Spalte; chapterEndAlign: 'text' setzt sie direkt unter den letzten Absatz.
placement: options.placement,
+ chapterEndAlign: 'text',#Die Linie weglassen
Ohne die Linie halten die Fußnoten über spaceAbove und spaceBelowRule weiterhin Abstand zum Text.
- separator: { width: 0.25, lineWidth: pt(0.5), color: col('oxblood') },
+ separator: { enabled: false },Häufige Fehler
Häufiger Fehler
Ein Auftakt reserviert Höhe bis zu seinem tiefsten an der Seite verankerten Element
Ein Auftakt mit erweiterter Gestaltung reserviert die Höhe seines tiefsten Elements, und an der Seite oder am Anschnitt verankerte Elemente unterhalb der Überschrift zählen mit, sodass Schmuck am Seitenfuß den Text auf die nächste Seite schiebt. Geben Sie einem solchen Element reserve: false (seit postext 1.5): es wird dort gemalt, wo es verankert ist, und reserviert nichts. Elemente, die dem Band selbst folgen (an seinem Fuß verankert oder 'fill' hoch), bestimmen nie seine Höhe. Gestaltete Auftakte →
Layoutwarnung · undefinedFootnote
Fußnote ohne Definition
Ursache. Ein Fußnotenzeichen [^id] verweist auf eine Anmerkung, die kein Absatz [^id]: definiert, die Nummer steht daher über einer leeren Anmerkung.
Lösung. Ergänzen Sie einen Absatz [^id]: mit der Anmerkung oder korrigieren Sie die ID des Fußnotenzeichens. Doku →
Layoutwarnung · unusedFootnote
Fußnote ohne Verweis
Ursache. Eine Definition [^id]: hat kein Fußnotenzeichen im Text, die Anmerkung wird daher nicht gesetzt.
Lösung. Verweisen Sie mit [^id] an der passenden Stelle auf sie oder löschen Sie die Definition. Doku →
- Ein Fußnotenzeichen in einer Legende, einer Tabellenzelle oder einer Überschrift erscheint, wie es geschrieben ist: Fußnoten werden nur in Absätzen, Listeneinträgen, Zitaten und Kästen erkannt.
- Eine Fußnote wird nie über Spalten geteilt: Eine, die höher ist als ihre Spalte, läuft über den Fuß hinaus. Halten Sie Fußnoten bei wenigen Zeilen, wie es Herausgeber tun.
Nachweise
- Rezept
- Ignacio Ferro
- Text
- La vida de Lazarillo de Tormes, Burgos edition of 1554: the prologue and the beginning of the first treatise · Anonymous · gemeinfrei
- The Life of Lazarillo de Tormes, translated by Clements Markham (1908), with his notes: the prologue and the first chapter, abridged · Clements Markham · gemeinfrei
- The Spanish notes, adapted from Markham's and written for this edition · Ignacio Ferro · CC BY 4.0
- Schriften
- EB Garamond (SIL OFL 1.1) · Bodoni Moda (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)
- Code
- MIT, wie Postext
Diesen Text bearbeiten ↗ (öffnet sich in einem neuen Tab)Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)


