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

レシピ集 · 第2章 · 文字と本文

ページごとに注を数えるロシア語の小説

『戦争と平和』第1章を130 × 200 mmに。会話のダッシュ、アステリスクで示すトルストイ自身の仏語訳、行末で分けない語、語で書く巻と編の番号まで組みます。

このページの内容
出力
Canvas · PDF
レベル
中級
Postext
Postext 1.100.0で検証済み
1.100.0以上が必要 · postext-pdf ≥ 1.100.0
ライセンス
2026年12月2日更新
コードMIT · 本文MIT

4〜5ページ(全10ページ)

  • 英語の見本:日本語版はまだありません
  • 仕上がり130 × 200 mm
  • 1段
  • Old Standard TT 10.5/13.2
  • Oranienbaum
  • 10ページ
  • レベル
  • Postext 1.100.0
  • 組版時間33 ms
  • コード149行

かんたんな説明

『戦争と平和』の冒頭をロシア語で、昔ながらの上製本のように組みます。フランス語のせりふは各ページの下に訳され、アステリスクは次のページでまた一つから始まります。

できあがり

『戦争と平和』(Война и мир)第1巻第1編第1章の全文を、全集第9巻(1937年)に拠って、130 × 200 mmのページに組みます。ロシアの84 × 108/32判の仕上がり寸法です。本文はOld Standard 10.5 pt、行送り13.2 pt、行長100 mmの34行。アンナ・パーヴロヴナとワシーリイ公爵は半ばフランス語で話し、トルストイ自身の訳がページの下に入り、アステリスクはページごとに始めから数えます。見出しはOranienbaumで、Том первый、Часть перваяと語で書きます。前には黒と煉瓦色の扉があり、裏にその版の言語による断り書きがあります。

このレシピが答える質問

  • ロシア語の小説を組むには?会話のダッシュ、ページごとにアステリスクで数える注、分けない語
  • 脚注を付けるには?
  • 会話のダッシュ、段落頭の年号、価格、記号そのものを、Markdownに誤読させずに書くには?
  • 柱を設定するには(左ページに書名、右ページに章タイトル、ノンブルは小口側)?

手短な答え

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

材料

種類
Old Standard TT, Oranienbaum (SIL OFL 1.1)
素材
なし:画像はすべてコードで描画

作り方

#1 · 言語とアステリスクを決める

コードは上の手短な答えです。locale: 'ru'はロシア語の規則で語を分け、前置詞や数やダッシュをその語から離さず、注をページごとに数えます。numberFormat: 'symbols'で番号がアステリスクになります。合印はロシア語の習慣どおり、句点や読点の前、疑問符の後に打ちます。句点だけが次の行に落ちることはありません。行長100 mmはこれだけの規則には狭いので、字間に少し余裕を与えています。フランス語の箇所は:ltr[…]{lang=fr}に入れ、フランス語の規則で分けます。

#2 · 全紙からページを取る

script.js · 36〜41行コード全体で見る
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 · 語の字間を空け、母音にアクセントを付ける

script.js · 66〜68行コード全体で見る
// 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 · 巻と編を語で書く

script.js · 72〜90行コード全体で見る
// 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 · 柱

script.js · 94〜106行コード全体で見る
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色の扉

script.js · 110〜130行コード全体で見る
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) }),
];

枠は節のヘッダーに置きます。そこならページ全体を囲めます。文字は見出しとその属性から取ります。

レシピの全体

Sandbox
// ═══ 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が決めます。

クレジット

レシピ
Ignacio Ferro
本文
  • Война и мир, 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)
Sandbox