かんたんな説明
昔の本のページの割り付けを論じたエッセイの3ページです。2つの段と向かい合う2ページのどこでも、文字の行を同じ高さにそろえる方法を示します。
できあがり
製本をテーマにした作品集『The Ruled Page』の9〜11ページには、中世の写字生がページに与えた比率を論じるエッセイ「The Secret Canon」が載っています。余白はエッセイが説くカノンのとおり2:3:4:6で、見開きで左右対称にとり、210 × 280mmの仕上がりの中にVollkornの2段組みを収めます。ページの上には淡い赤でベースライングリッドを描き、両段と向かい合う両ページの本文がその上に並びます。Playfair Displayの題は章扉の第1段を埋め、カノンの図は第2段の頭に立ちます。節見出しはグリッドから半行ずれ、その下の本文はグリッドに戻ります。小さな文字の工房ノートは、独自の10ptの行送りで組みます。11ページでは、ページ幅の図の下でエッセイが同じ長さにそろえた2段で終わり、第2段を奥付が締めくくります。
このレシピが答える質問
- 本のページを設定するには(仕上がりサイズ、左右対称ののどと小口の余白、2段組みと段間)?
- テキストをベースライングリッドに固定し、段や見開きをまたいで行をそろえるには?
- 段の下端をそろえ、最終ページの段の長さを均等にするには(垂直方向の両端そろえ)?
- ウィドウ、オーファン、最終行の一語(ラント)を避け、見出しを本文と離さないようにするには?
手短な答え
const LEAD = 13.4; // pt: the body leading is the pitch of the baseline grid
const UNIT = 8; // mm: the margins step 2:3:4:6 in units of 8 mm, like the canon's
const LINES = 44; // lines per column: the text block is a whole number of leads tall
const TRIM = { width: 210, height: 280 }; // mm
const MM_PER_PT = 25.4 / 72;
const page = {
sizePreset: 'custom', width: mm(TRIM.width), height: mm(TRIM.height), dpi: 150,
backgroundColor: col('paper'),
margins: { mirror: true, // left is the inner margin; mirror swaps it on every verso
left: mm(2 * UNIT), top: mm(3 * UNIT), right: mm(4 * UNIT), // 16, 24 and 32 mm
bottom: mm(TRIM.height - 3 * UNIT - LINES * LEAD * MM_PER_PT) }, // 48 mm: six units
// The layout keeps to the grid whether or not the overlay draws it.
baselineGrid: { enabled: true, color: col('grid') },
};
const GUTTER = 6; // mm: 162 mm of text block make two columns of 78 mm
const layout = { layoutType: 'double', gutterWidth: mm(GUTTER),
columnRule: { enabled: true, color: col('rule'), lineWidth: pt(0.4) } };
const body = { fontFamily: 'Vollkorn', fontSize: pt(9.8), lineHeight: pt(LEAD) };
// Lists add no space of their own (any whole number of leads would do). The grid never
// absorbs a list's top margin: the default 1.5 em (14.7 pt here) would set the items
// 1.3 pt off the lines of the column beside them, until the list reaches a new column.
const onGrid = { marginTop: pt(0), marginBottom: pt(0) };
材料
- 機能
- 見開きの余白ベースライングリッド段末そろえ意図してグリッドを外す図の配置ウィドウ、オーファン、ラント段落スタイル仕上がりサイズ1段組みと2段組み段間罫単位と寸法本文の書体箇条書きとチェックリスト番号付きリスト見出しの階層柱とノンブルページの役割ごとの柱リソースとしての図と表キャンバス上のページ
- 種類
- Vollkorn, Playfair Display, Vollkorn SC (SIL OFL 1.1)
- 素材
- The two drawings, made in code in the page's palette (Postext Cookbook, CC BY 4.0)
作り方
#1 · 見出しはグリッドを外れてよく、リストは外さない
headings: { fontFamily: 'Playfair Display', color: col('ink'), balancing,
levels: [
// parity 'odd': the essay opens on a recto.
// Two lines of 46 pt, each four leads tall, then one lead: the text starts on line 10.
{ level: 1, breakBefore: { enabled: true, parity: 'odd' },
fontSize: pt(46), lineHeight: pt(4 * LEAD), italic: true, color: col('rubric'),
marginBottom: pt(LEAD) },
// A lead and a half above puts the head between two grid lines. The margin below
// needs no fitting: the engine snaps the text under a head to the next grid line.
{ level: 2, fontSize: pt(12.5), lineHeight: pt(LEAD), marginTop: pt(1.5 * LEAD) },
] },
// Lists add no space of their own (onGrid, in the short answer): items stay on the grid.
unorderedLists: { ...onGrid, bulletChar: '–', color: col('rubric'), fontWeight: 400 },
orderedLists: { ...onGrid, color: col('rubric') }, // numbers in the rubric, text in ink
見出しの上のアキは設定したとおりに保たれるので、行送り1.5行分にすると見出しは2本のグリッド線のあいだに入り、その下の本文は次の線にスナップされます(ベースライングリッド)。リストは最初の項目の前ではスナップされないため、手短な答えではリストの上下のアキを0にしています(行送りの整数倍でもかまいません)。既定の1.5emのままだと、10ページの3つの項目が隣の段の行より1.3pt下に並びます。題は46ptの2行がそれぞれ行送り4行分を取り、下のアキがさらに1行分を取るので、エッセイは10行目から始まります。

#2 · 意図してグリッドを離れ、そして戻る
paragraphStyles: [
{ id: 'note', fontSize: pt(7.8), lineHeight: pt(10), color: col('muted'),
boldColor: col('rubric'), firstLineIndent: pt(0), marginTop: pt(LEAD / 2) },
{ id: 'colophon', fontFamily: 'Vollkorn SC', fontSize: pt(7.5), lineHeight: pt(10),
color: col('muted'), textAlign: 'left', firstLineIndent: pt(0), marginTop: pt(LEAD) },
],
ノートは文字サイズ7.8pt、行送り10ptで組んだ:::paragraphsコンテナーで、グリッドから外れています。最後の段落のあと、位置は次のグリッド線まで切り上げられるので、続く見出しは本文のあとと同じ位置に立ちます(:::paragraphsコンテナー)。奥付も同じコンテナーを7.5pt、行送り10ptで使います。4行で40ptとなり、行送り3行分に0.2pt足りないだけなので、エッセイの最後の段は隣の段と同じ高さで終わります。
#3 · 図はグリッドが吸収できる位置に置く
// mm: a column wide and just short enough for a 17-lead band with its caption; a block wide
const CANON = [COLUMN_W, 61.8], PAGES = [BLOCK_W, 64];
const figure = (id, [width, height], placement, [caption, altText]) => ({
id, typeId: 'figure', kind: 'svg', svg: { fileId: `${id}.svg`, width, height },
placement, caption, altText, createdAt: 0, updatedAt: 0,
});
const resources = [
// A float never lands above the paragraph that cites it. A column 'top' float cited in
// the first column can still take the head of the second, on the same page.
figure('canon', CANON, { position: 'top' }, t(CAPTIONS.canon)),
// A page-wide 'top' float cannot, so it waits for the next page (gotcha: top-float-next-page).
// Each band is rounded up to whole leads, so the text under it stays on the grid.
figure('pages', PAGES, { position: 'top', span: 'page' }, t(CAPTIONS.pages)),
];
フロートは、それを参照する段落より上には置かれません(配置)。カノンの図は第1段で参照されますが、9ページの第2段の頭には入ることができます。10ページで参照されるページ幅の比較図は、11ページまで待ちます。図の帯はそれぞれ行送りの整数倍に切り上げられるので、図の下の本文はグリッド線から始まり、隣の段とも向かいのページともそろいます。図の大きさはこの切り上げに合わせて決めてください。61.8mmならカノンの帯はキャプションを含めて行送り17行分ですが、62.5mmにすると18行分になり、キャプションの下にほぼ1行分の白が残ります。

#4 · 段末そろえで段の長さをそろえる
// On by default: it fills a column a keep rule leaves short, and cuts the last page level.
const balancing = { enabled: true };
9ページと10ページの満杯の段は、どれも44行目で終わります。版面がちょうど行送り44行分で、原稿をそれに合わせて調整したからです。次の行と離さない設定(keep-with-next)と、ウィドウ、オーファン、ラントの規則は既定で有効です。どれかが段を1行短く終わらせると、段末そろえは足りない分のアキをそれより前の見出しの上に入れ(段末そろえ)、そこが隙間として見えてしまいます。段末そろえが埋めるものがなくなるまで原稿を調整してください。最終ページでは、段末そろえが残りの行を割り振り、両方の段が同じ行で終わります。
#5 · 余白を左右対称にし、9ページから数える
const OUTER = 4 * UNIT; // mm: the heads end where the text block does
const RISE = 1.5 * UNIT; // mm: heads 12 mm into the head margin; the drop folio 12 mm below
const TAB = 7; // mm from a folio to the title beside it
const onPage = (edge, x) => ({ anchor: { to: 'page', edge },
offset: { x: mm(x), y: mm(RISE) } });
const head = (id, content, parity, placement, extra = {}) => ({
kind: 'text', id, content, parity, placement, pages: 'body', // never on the opener
fontFamily: 'Vollkorn SC', fontSize: pt(8.5), fontWeight: 600, letterSpacing: pt(0.8),
color: col('muted'), ...extra,
});
const folio = { fontFamily: 'Vollkorn', fontWeight: 700, letterSpacing: pt(0),
color: col('rubric') };
const header = { elements: [
head('verso-folio', '{pageNumber}', 'even', onPage('top-left', OUTER), folio),
head('verso-title', '{title}', 'even', onPage('top-left', OUTER + TAB)),
head('recto-title', '{chapterTitle}', 'odd', onPage('top-right', -(OUTER + TAB))),
head('recto-folio', '{pageNumber}', 'odd', onPage('top-right', -OUTER), folio),
] };
// The opener drops its folio into the foot margin, centred under the text block.
const underBlock = { anchor: { to: 'container', edge: 'top' }, offset: { y: mm(RISE) } };
const footer = { elements: [
head('drop-folio', '{pageNumber}', 'all', underBlock, { ...folio, pages: 'opener' }),
] };
// startAt prints the folios from 9; pageIndexOffset counts the 8 pages before them, so
// mirroring, parity and breakBefore follow the book (7 would add a blank page).
const continuation = { pageIndexOffset: 8, pageNumbering: { startAt: 9 } };
手短な答えでは地の余白を計算で求めます。280mmの仕上がりから天の余白24mmと、ちょうどLINES行分の版面(44 × 13.4pt = 208mm)を引くと48mmが残り、2:3:4:6の比が求める6単位になります。mirror: trueにすると、leftとして設定した16mmはのど側の余白になり、奇数ページでは左、偶数ページでは右に来ます(見開きの余白)。そのため、ページの端からOUTERmm離して置いた柱は、小口側で版面と同じ位置で終わります。pages: 'body'は柱を章扉から外します。startAt: 9でノンブルは9〜11となり、pageIndexOffset: 8がその前の8ページを数えるので、左右対称の配置、柱の奇数・偶数、breakBefore: 'odd'が製本された本と一致します。オフセットを7にすると最初のページが偶数ページとして数えられ、奇数ページへの改ページでエッセイの前に白ページが1枚入ります。
レシピの全体
// ═══ Postext Cookbook · Nº 013 · A book page on a baseline grid ═════════════════════
// https://postext.dev/en/cookbook/baseline-grid-book-page
// Code: MIT · Text: original (CC BY 4.0) · Pictures: drawn in code (CC BY 4.0)
// Fonts: Vollkorn, Playfair Display, Vollkorn SC (SIL OFL 1.1) · Needs postext ≥ 1.46.2
// An essay on the canon of page proportions, on a page that shows its geometry and grid.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
const LANG = 'en'; // @lang: the sample document's language ('en' | 'es' | 'pt' | 'fr' | 'de' | 'it')
const RECIPE = 'baseline-grid-book-page';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// A scribe's colours: ink, one rubric red and the pale red of a ruled page.
const palette = {
ink: '#211d1a', // text: a warm near-black
rubric: '#b3261e', // the one accent: title, numbers, folios, the drawings' lines
grid: '#efc6bd', // the baseline grid, as pale as a manuscript's ruling
rule: '#d5cbbb', // the column rule and the drawings' hairlines
muted: '#716860', // running heads, the workshop note, the colophon (5.1:1 on paper)
tint: '#ede4d3', // the ground of the drawings
paper: '#fbf8f1',
};
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' } })),
// Defaults this config does not restate link to main-color: point it at the rubric.
{ id: 'main-color', name: 'rubric (defaults)', value: { hex: palette.rubric, model: 'hex' } },
];
// #region answer: one grid for the whole spread: trim, mirrored margins, two columns, leading
const LEAD = 13.4; // pt: the body leading is the pitch of the baseline grid
const UNIT = 8; // mm: the margins step 2:3:4:6 in units of 8 mm, like the canon's
const LINES = 44; // lines per column: the text block is a whole number of leads tall
const TRIM = { width: 210, height: 280 }; // mm
const MM_PER_PT = 25.4 / 72;
const page = {
sizePreset: 'custom', width: mm(TRIM.width), height: mm(TRIM.height), dpi: 150,
backgroundColor: col('paper'),
margins: { mirror: true, // left is the inner margin; mirror swaps it on every verso
left: mm(2 * UNIT), top: mm(3 * UNIT), right: mm(4 * UNIT), // 16, 24 and 32 mm
bottom: mm(TRIM.height - 3 * UNIT - LINES * LEAD * MM_PER_PT) }, // 48 mm: six units
// The layout keeps to the grid whether or not the overlay draws it.
baselineGrid: { enabled: true, color: col('grid') },
};
const GUTTER = 6; // mm: 162 mm of text block make two columns of 78 mm
const layout = { layoutType: 'double', gutterWidth: mm(GUTTER),
columnRule: { enabled: true, color: col('rule'), lineWidth: pt(0.4) } };
組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)
アレンジ
#印刷用にグリッドを隠す
enabledが切り替えるのは、仕上がったページの上に描く線だけです。どちらの場合もレイアウトは13.4ptのグリッドに従うので、行は1本も動きません。
- baselineGrid: { enabled: true, color: col('grid') },
+ baselineGrid: { enabled: false },#段末そろえの効果を見る
段末そろえを切ると、11ページは最後の8行と奥付を第1段に流し込み、第2段を空のまま残します。
-const balancing = { enabled: true };
+const balancing = { enabled: false };よくあるつまずき
つまずき
'top'のフロートは参照ページの先頭を許さない限り次のページに置かれる
既定では、フロートが自分の参照より上に置かれることはありません。そのため、Nページで参照したページ幅の'top'フロートはN+1ページの頭に置かれます。リソースまたはその種類のdefaultPlacementにplacement.citingPage: trueを設定すると(本全体ならlayout.floatsAtCitingPage、postext 1.25から)、layout.maxTopFraction以内に収まり参照行がそのページに残る場合は代わりにNページの先頭に置かれ、参照より前の本文はその下に送られます。章の最初のページと強制改ページの後のページの先頭には置かれません。その場合は次のページに置かれ、'auto'または'bottom'なら参照したページの下端に入れられます。 図の配置 →
topフロートを参照元のページに置かないという規則は、ページ幅のフロートに当てはまります。段のtopフロートは、あとの段の頭であれば参照元のページにも置かれます。9ページの図1.1がその例です。- ページサイズ、余白、段間は絶対単位(mm、pt、cm、in)で指定します。そこでの
emには基準となる文字サイズがないため、ビルドは「dimensionToPx: baseFontSizePx is required for unit "em"」で止まります。 - Vollkornの語間は0.2emと狭いため、約50字の段では両端そろえの行の一部がゆるくなったり詰まったりします。見本はキャプチャのゆるい行のレポートと照らして1行ずつ調整しました。本文や行長を変えたら、もう一度確認してください。
クレジット
- 本文
- The essay “The Secret Canon” and its Spanish version “El canon secreto”, written for this recipe · Postext Cookbook · CC BY 4.0
- 画像
- The two drawings, made in code in the page's palette · Postext Cookbook · CC BY 4.0
- フォント
- Vollkorn (SIL OFL 1.1) · Playfair Display (SIL OFL 1.1) · Vollkorn SC (SIL OFL 1.1)


