かんたんな説明
『戦争と平和』の冒頭をロシア語で、昔ながらの上製本のように組みます。フランス語のせりふは各ページの下に訳され、アステリスクは次のページでまた一つから始まります。
できあがり
『戦争と平和』(Война и мир)第1巻第1編第1章の全文を、全集第9巻(1937年)に拠って、130 × 200 mmのページに組みます。ロシアの84 × 108/32判の仕上がり寸法です。本文はOld Standard 10.5 pt、行送り13.2 pt、行長100 mmの34行。アンナ・パーヴロヴナとワシーリイ公爵は半ばフランス語で話し、トルストイ自身の訳がページの下に入り、アステリスクはページごとに始めから数えます。見出しはOranienbaumで、Том первый、Часть перваяと語で書きます。前には黒と煉瓦色の扉があり、裏にその版の言語による断り書きがあります。
このレシピが答える質問
- ロシア語の小説を組むには?会話のダッシュ、ページごとにアステリスクで数える注、分けない語
- 脚注を付けるには?
- 会話のダッシュ、段落頭の年号、価格、記号そのものを、Markdownに誤読させずに書くには?
- 柱を設定するには(左ページに書名、右ページに章タイトル、ノンブルは小口側)?
手短な答え
// The language hyphenates by the Russian patterns, keeps a preposition with its word and a
// dash off the line start (bodyText.wordTies 'avoid'), holds the space after a dialogue's
// opening dash at its own width, counts the notes again on every page and indents their
// first line. The indents below are the Russian ones: 1,5 em, the first paragraph included.
const LOCALE = 'ru';
const bodyText = { // config().bodyText
fontFamily: TEXT, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
firstLineIndent: em(1.5), indentAfterHeading: true, // the default leaves the first one flush
hyphenation: { leftMin: 2, rightMin: 2 }, maxWordSpacing: 1.6, minWordSpacing: 0.8,
wordTies: 'avoid', // the default in these languages
maxJustifyTracking: 15, // room for the ties in a 100 mm line
};
const footnotes = { // config().footnotes: *, **, ***, again from * on the next page
numberFormat: 'symbols', // locale 'ru' gives symbols: ['*'] and numbering: 'page'
fontSize: pt(8.6), lineHeight: pt(10.6),
separator: { width: 0.25, lineWidth: pt(0.4), color: col('ink') },
};
材料
- 機能
- 文書の言語としてのキリル文字の諸言語行末で分けない語脚注ハイフネーションと文書の言語最適な改行(Knuth–Plass)文字スタイル逆方向の文字列番号付き見出しデザインした章扉見出しスタイル見出しの属性仕上がりサイズ柱とノンブル見開きの余白字下げ、行そろえ、段落間隔段落スタイル文書のメタデータセマンティックカラーパレットPDFの書き出しPDFに埋め込むフォント
- 種類
- Old Standard TT, Oranienbaum (SIL OFL 1.1)
- 素材
- なし:画像はすべてコードで描画
作り方
#1 · 言語とアステリスクを決める
コードは上の手短な答えです。locale: 'ru'はロシア語の規則で語を分け、前置詞や数やダッシュをその語から離さず、注をページごとに数えます。numberFormat: 'symbols'で番号がアステリスクになります。合印はロシア語の習慣どおり、句点や読点の前、疑問符の後に打ちます。句点だけが次の行に落ちることはありません。行長100 mmはこれだけの規則には狭いので、字間に少し余裕を与えています。フランス語の箇所は:ltr[…]{lang=fr}に入れ、フランス語の規則で分けます。
#2 · 全紙からページを取る
const [TOP, INNER, OUTER, LINES] = [22, 15, 15, 34];
const page = {
sizePreset: '84x108/32', dpi: 150, backgroundColor: col('paper'), // the sheet of GOST 5773
margins: { top: mm(TOP), bottom: mm(200 - TOP - LINES * LINE), // 130 × 200 mm
left: mm(INNER), right: mm(OUTER), mirror: true },
};
sizePreset: '84x108/32'はGOST 5773の130 × 200 mmです。地の余白は34行から計算し、mirrorが偶数ページで左右を入れ替えます。
#3 · 語の字間を空け、母音にアクセントを付ける
// The edition's italics (грипп, рап) are spaced here, as Russian books set an emphasis
// before italics took over. A stress is U+0301 after its vowel: что́, сто́ите.
const characterStyles = [{ id: 'razryadka', name: 'Разрядка', letterSpacing: em(0.16) }];
当時のロシアの本は、強調する語の字間を空けました。разрядкаはletterSpacingを持つ文字スタイルで、底本が斜体にした二語、гриппとрапに使います。アクセントは母音の後のU+0301で、что́やсто́итのように打ちます。
#4 · 巻と編を語で書く
// The Markdown has # Том, ## Часть and ### Глава; 'replace' prints the number alone. Том is
// masculine, so its ordinal asks for -masculine; Часть is feminine, the Russian default.
const level = (n, numberingTemplate, design, minHeight, extra = {}) => ({ level: n,
numberingTemplate, numberPosition: 'replace', marginTop: pt(0), marginBottom: pt(0),
breakBefore: { enabled: false },
advancedDesign: { enabled: true, minHeight: pt(minHeight * LEAD), slot: { elements: design } },
...extra });
const levels = [
level(1, 'Том {1:ordinal-masculine}', [
text('volume', '{titleText}', DISPLAY, 17, at('container', 'top', 0, 2.2 * LINE),
caps(2.4, 'red')),
{ kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(0.6), color: col('red'),
placement: { ...at('container', 'top', 0, 4.5 * LINE), size: { width: mm(18) } } },
], 5, { breakBefore: { enabled: true, parity: 'odd' } }),
level(2, 'Часть {2:ordinal}', [text('part', '{titleText}', DISPLAY, 11.5,
at('container', 'top', 0, 0.4 * LINE), caps(1.6))], 2),
level(3, '{3:upper-roman}', [text('chapter', '{titleText}', DISPLAY, 13,
at('container', 'top', 0, 0.9 * LINE), {})], 3),
];
{1:ordinal-masculine}と{2:ordinal}は番号を文書の言語の語で書き、numberPosition: 'replace'が見出しの代わりにそれを刷ります。Markdownには# Томと## Частьがあるだけで、番号を打ち直す必要はありません。
#5 · 柱
const head = (id, content, parity, edge, x, extra = {}) => ({ kind: 'text', id, content, parity,
pages: 'body', fontFamily: TEXT, fontSize: pt(9), color: col('ink'),
placement: at('page', edge, x, 13), ...extra });
const header = { elements: [
head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER),
head('verso-author', '{author}', 'even', 'top', 0, { italic: true }),
head('recto-title', '{title}. {chapterTitle}', 'odd', 'top', 0, { italic: true }),
head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER),
{ kind: 'rule', id: 'under', direction: 'horizontal', thickness: pt(0.4), color: col('ink'),
pages: 'body', placement: { ...at('page', 'top', 0, 18), size: { width: mm(100) } } },
] };
const footer = { elements: [{ ...head('drop', '{pageNumber}', 'all', 'bottom', 0),
pages: 'opener', placement: at('page', 'bottom', 0, -11) }] };
偶数ページに著者、奇数ページに書名と巻を斜体で置き、下に細い罫を引きます。pages: 'body'で巻頭には出さず、ノンブルを下に落とします。
#6 · 2色の扉
const front = (id, elements, furniture = [], extra = {}) => ({ id, numbered: false,
runningChapter: false, breakBefore: { enabled: true, parity: 'any' }, numberPosition: 'before',
header: { elements: furniture }, footer: { elements: [] },
advancedDesign: { enabled: true, slot: { elements }, ...extra } });
const frame = (id, inset, width) => ({ kind: 'box', id,
style: { borderColor: col('red'), borderWidth: pt(width) },
placement: { ...at('page', 'top-left', inset, inset),
size: { width: mm(130 - 2 * inset), height: mm(200 - 2 * inset) } } });
const headingStyles = [
front('title-page', [
text('author', '{attr.first}', DISPLAY, 17, at('page', 'top', 0, 30), caps(1.6)),
text('title', '{titleText}', DISPLAY, 40, { ...at('page', 'top', 0, 66),
size: { width: mm(98) } }, { ...caps(0.6, 'red'), lineHeight: 1.1 }),
text('subtitle', '{subtitle}', TEXT, 11, at('page', 'top', 0, 92), { italic: true }),
text('imprint', '{attr.imprint}', DISPLAY, 10, at('page', 'bottom', 0, -29), caps(1.6)),
text('year', '{attr.year}', DISPLAY, 10, at('page', 'bottom', 0, -23)),
], [frame('outer', 10, 2.2), frame('inner', 12.2, 0.5)]), // the section's header: whole page
// The note sits low on the verso of the title page, under its label.
front('note-page', [text('label', '{titleText}', DISPLAY, 10,
at('container', 'top', 0, 17 * LINE), caps(1.2, 'red'))], [], { minHeight: pt(19 * LEAD) }),
];
枠は節のヘッダーに置きます。そこならページ全体を囲めます。文字は見出しとその属性から取ります。
レシピの全体
// ═══ Postext Cookbook · Nº 205 · A Russian novel with its notes counted by page ═══════
// https://postext.dev/en/cookbook/russian-novel-notes-by-page
// Code: MIT · Text: L. Tolstoy, Война и мир, I, I, I, PSS vol. 9, 1937 (PD, ru.wikisource)
// Fonts: Old Standard TT, Oranienbaum (SIL OFL 1.1) · Needs postext ≥ 1.100.0
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the note on the text ('en' | 'es' | 'ru')
const RECIPE = 'russian-novel-notes-by-page';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black on a warm paper and the brick red of a title page printed in two inks, as the
// Leningrad presses of the thirties set their classics.
const palette = {
ink: '#1e1a17', // text, the running heads, the folios
red: '#a3301f', // the title, the frame, the volume
muted: '#675e55', // the note on the text, the colophon
paper: '#faf5ea', // a cream book paper
};
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' } })),
{ id: 'main-color', name: 'red (defaults)', value: { hex: palette.red, model: 'hex' } },
];
const [TEXT, DISPLAY] = ['Old Standard TT', 'Oranienbaum']; // обыкновенная; a display antiqua
const [BODY, LEAD] = [10.5, 13.2]; // pt
const LINE = (LEAD * 25.4) / 72; // mm: one line, 4.66
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const text = (id, content, fontFamily, size, placement, extra = {}) => ({ kind: 'text', id,
content, fontFamily, fontSize: pt(size), color: col('ink'), align: 'center',
overflow: 'wrap', placement, ...extra });
const caps = (tracking, color = 'ink') => ({ textTransform: 'uppercase',
letterSpacing: pt(tracking), color: col(color) });
// #region page: 84 × 108/32, 130 × 200 mm trimmed; 34 lines of 13.2 pt, 100 mm wide
const [TOP, INNER, OUTER, LINES] = [22, 15, 15, 34];
const page = {
sizePreset: '84x108/32', dpi: 150, backgroundColor: col('paper'), // the sheet of GOST 5773
margins: { top: mm(TOP), bottom: mm(200 - TOP - LINES * LINE), // 130 × 200 mm
left: mm(INNER), right: mm(OUTER), mirror: true },
};
// #endregion
// #region answer: what locale 'ru' brings, and the notes set with asterisks
// The language hyphenates by the Russian patterns, keeps a preposition with its word and a
// dash off the line start (bodyText.wordTies 'avoid'), holds the space after a dialogue's
// opening dash at its own width, counts the notes again on every page and indents their
// first line. The indents below are the Russian ones: 1,5 em, the first paragraph included.
組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)
よくあるつまずき
- 1ページに三つか四つを超えるアステリスクは読みにくく、9ページでは五つになります。このレシピのように一つのせりふの訳を一つの注にまとめるか、
numberFormat: 'decimal'で数字にします。 - 句点の後に打った合印は句点の後に残ります。順序はMarkdownが決めます。
クレジット
- 本文
- Война и мир, volume I, part I, chapter I, complete, after the Complete Works (PSS, vol. 9, 1937) in the transcription of ru.wikisource, with slips of the transcription corrected, Tolstoy’s translations placed as in current editions and the note mark set before the stop · Leo Tolstoy · パブリックドメイン
- The note on the text and the colophon · Postext Cookbook · オリジナル
- フォント
- Old Standard TT (SIL OFL 1.1) · Oranienbaum (SIL OFL 1.1)


