本文へスキップ
レシピ番号71

レシピ集 · 第6章 · 囲みと注

引用した段の地に置く脚注

Markdownの[^id]の合印が、引用した段の地に置く番号付きの脚注になります。1段組み、章末注、通し番号への切り替えも付けています。

このページの内容
レベル
中級
Postext
Postext 1.65.0で検証済み
1.25.0以上が必要 · postext-pdf ≥ 1.25.0
ライセンス
2026年10月10日更新
コードMIT · 本文CC BY 4.0

2〜3ページ(全3ページ)

  • 英語の見本:日本語版はまだありません
  • 仕上がり210 × 280 mm
  • 2段, 段間7 mm
  • EB Garamond 10.5/13.5
  • Bodoni Moda
  • IBM Plex Sans Condensed
  • 3ページ
  • レベル
  • Postext 1.65.0
  • 組版時間28 ms
  • コード164行

かんたんな説明

スペインの古典小説の学校向けの版を2段組みで組みます。注をそれに触れた段の下端に置き、読者がページをめくらずに注を読めるようにする方法を示します。

できあがり

『ラサリーリョ・デ・トルメスの生涯』(Lazarillo de Tormes)の学校向けの版です。210 × 280 mmの判型に、EB Garamondで2段に組みます。収めるのは序文と第1話の冒頭で、ラサロがトルメス川の水車小屋で生まれ、盲人に連れられて世に出るところです。注は、1554年の読者は知っていて今の読者は知らないことを説明します。テハレスの村、ロス・ヘルベス島への遠征、サラマンカの橋にある石の牡牛などです。各注は、それを引用した段の地に、牛血色(オックスブラッド)の短い罫の下に小さく組まれます。ページをめくらずに、視線を番号から注へ下ろし、また戻せます。英語版には、クレメンツ・マーカム(Clements Markham)が1908年の自身の英訳に付けた注を載せています。

このレシピが答える質問

  • 脚注を付けるには?

手短な答え

script.js · 42〜54行コード全体で見る
// 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') },
});

材料

種類
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 · どの章扉も同じ行まで下げる

script.js · 58〜76行コード全体で見る
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 · 偶数ページに書名、奇数ページに章名

script.js · 80〜97行コード全体で見る
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 · ほかの配置を試す

script.js · 202〜230行コード全体で見る
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話へ続けます。

レシピの全体

Sandbox
// ═══ 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

組み立てた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]を書いて参照するか、定義を削除してください。 ドキュメント →

  • キャプション、表のセル、見出しの中の合印は、書いたとおりの文字列で刷られます。注として読み取られるのは、段落、リストの項目、引用、囲みの中だけです。
  • 注は段をまたいで分割されません。段より背の高い注は地からはみ出します。編集者がするように、注は数行にとどめてください。

クレジット

レシピ
Ignacio Ferro
本文
フォント
EB Garamond (SIL OFL 1.1) · Bodoni Moda (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)
SandboxPDF