かんたんな説明
スペインの古典小説の学校向けの版を2段組みで組みます。注をそれに触れた段の下端に置き、読者がページをめくらずに注を読めるようにする方法を示します。
できあがり
『ラサリーリョ・デ・トルメスの生涯』(Lazarillo de Tormes)の学校向けの版です。210 × 280 mmの判型に、EB Garamondで2段に組みます。収めるのは序文と第1話の冒頭で、ラサロがトルメス川の水車小屋で生まれ、盲人に連れられて世に出るところです。注は、1554年の読者は知っていて今の読者は知らないことを説明します。テハレスの村、ロス・ヘルベス島への遠征、サラマンカの橋にある石の牡牛などです。各注は、それを引用した段の地に、牛血色(オックスブラッド)の短い罫の下に小さく組まれます。ページをめくらずに、視線を番号から注へ下ろし、また戻せます。英語版には、クレメンツ・マーカム(Clements Markham)が1908年の自身の英訳に付けた注を載せています。
このレシピが答える質問
- 脚注を付けるには?
手短な答え
// 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') },
});
材料
- 機能
- 脚注上付きと下付き1段組みと2段組みデザインした章扉見出しの属性柱とノンブル見開きの余白ページの役割ごとの柱段落スタイルセマンティックカラーパレット用紙の色ウィドウ、オーファン、ラントPDFの書き出しアクセシブルなタグ付きPDF
- 併用する機能
- 段抜きの章見出し帯PDFに埋め込むフォント
- 種類
- EB Garamond, Bodoni Moda, IBM Plex Sans Condensed (SIL OFL 1.1)
- 素材
- なし:画像はすべてコードで描画
作り方
#1 · 注はその場所で引用し、定義はどこに書いてもよい
設定は前出の手短な答えにあり、残りはMarkdownです。natives of Tejares,[^9]はコンマに密着した上付きの番号を刷り、[^9]:で始まる段落が注の本体になります。定義はどこに書いても本文の流れから外れるので、この見本では、元のファイルでマーカムの注が置かれていたのと同じく、すべて章の終わりにまとめています。番号は引用の順に振られるため、Markdownのidは単語でもかまいません(スペイン語版では[^tejares])。章の番号を振り直しても、注を書き換える必要はありません。
#2 · 段に注の分の場所を残す
1行を組む前に、レイアウトはその行で初めて引用される注の高さを足し、それが段の最初の注であれば罫の高さも足します。下に注が収まらない行は、ウィドウとオーファンの規則に従って段落ごと次の段に送られます。そのため、番号が別の段の注を指すことはありません。注は地から積み上げられ、注自身のサイズと行送りで組まれてベースライングリッドからは外れますが、その上の本文はグリッドに乗ったままです。段末そろえは本文だけを数えます。
#3 · どの章扉も同じ行まで下げる
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) } } },
] },
};
章扉は両段にまたがり、章のキッカーを見出しのkicker属性から描きます。minHeightはグリッド10行分を確保します。これは2行のBodoniのタイトルとその罫が収まる高さで、どの章も本文が同じ行から始まり、罫が本文の1行目に重なることもありません。
#4 · 偶数ページに書名、奇数ページに章名
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' }] };
柱はページの偶奇に応じて固定し、ノンブルは小口側に置きます。pages: 'body'は章扉に柱を付けず、章扉には中央に下げたノンブルを付けます。長い章題はノンブルにぶつからず、120 mmで省略記号で終わります。
#5 · ほかの配置を試す
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);
どのスイッチも、オプションをひとつ変えて章を組み直します。One column(1段)は、注をページの地に組みます。1段組みではそこが段の地だからです。End of chapter(章末)は、注を章の最後の段落の後に組み、それが締めくくる段の地まで下げて、同じ罫の下に置きます。Continuous(通し番号)は、番号を1からやり直さず、序文から第1話へ続けます。
レシピの全体
// ═══ 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; }
組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)
アレンジ
#章末注を本文の直後に置く
placement: 'chapterEnd'の場合、既定では注は最後の段の地に置かれます。chapterEndAlign: 'text'にすると、最後の段落の直下に組まれます。
placement: options.placement,
+ chapterEndAlign: 'text',#罫をなくす
罫がなくても、注はspaceAboveとspaceBelowRuleの分だけ本文から離れます。
- separator: { width: 0.25, lineWidth: pt(0.5), color: col('oxblood') },
+ separator: { enabled: false },よくあるつまずき
つまずき
章扉はページに固定した要素のうち最も下のものまで高さを確保する
詳細デザインの章扉は、最も下にある要素までの高さを確保します。見出しより下にあるページや裁ち落としに固定した要素もこれに含まれるため、ページの下端に置いた装飾があると本文が次のページへ押し出されます。こうした要素にはreserve: falseを与えてください(postext 1.5から)。固定した位置に描かれ、高さは何も確保しません。帯そのものに従う要素(帯の下端に固定したものや、高さが'fill'のもの)が帯の高さを決めることはありません。 デザインした章扉 →
レイアウト警告 · undefinedFootnote
定義のない脚注
原因. [^id]の合印が、どの[^id]:段落にも定義されていない注を指しているため、空の注に番号だけが印字されます。
対処. 注の内容を書いた[^id]:段落を加えるか、合印のidを修正してください。 ドキュメント →
レイアウト警告 · unusedFootnote
参照されていない脚注
原因. [^id]:の定義に対応する合印が本文にないため、その注は組まれません。
対処. しかるべき位置に[^id]を書いて参照するか、定義を削除してください。 ドキュメント →
- キャプション、表のセル、見出しの中の合印は、書いたとおりの文字列で刷られます。注として読み取られるのは、段落、リストの項目、引用、囲みの中だけです。
- 注は段をまたいで分割されません。段より背の高い注は地からはみ出します。編集者がするように、注は数行にとどめてください。
クレジット
- 本文
- La vida de Lazarillo de Tormes, Burgos edition of 1554: the prologue and the beginning of the first treatise · Anonymous · パブリックドメイン
- The Life of Lazarillo de Tormes, translated by Clements Markham (1908), with his notes: the prologue and the first chapter, abridged · Clements Markham · パブリックドメイン
- The Spanish notes, adapted from Markham's and written for this edition · Ignacio Ferro · CC BY 4.0
- フォント
- EB Garamond (SIL OFL 1.1) · Bodoni Moda (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)


