# 多调希腊语荷马与译文对照

> 左页是《奥德赛》开头，右页是Eftaliotis的现代希腊语译文，用grc模式断词，每五行标一个行号。

- HTML版本: https://postext.dev/zh/cookbook/homer-polytonic-facing-translation
- 食谱 No. 202 · 字体与文字 · 难度 2 (中级) · 输出: Canvas
- 体裁: 诗歌
- 需要 postext ≥ 1.99.1 · 已用 1.99.1 测试，日期 2026-11-29
- 页面: [1](https://postext.dev/cookbook/homer-polytonic-facing-translation/en/p01.webp?v=ccab6327), [2](https://postext.dev/cookbook/homer-polytonic-facing-translation/en/p02.webp?v=ccab6327), [3](https://postext.dev/cookbook/homer-polytonic-facing-translation/en/p03.webp?v=ccab6327), [4](https://postext.dev/cookbook/homer-polytonic-facing-translation/en/p04.webp?v=ccab6327), [5](https://postext.dev/cookbook/homer-polytonic-facing-translation/en/p05.webp?v=ccab6327), [6](https://postext.dev/cookbook/homer-polytonic-facing-translation/en/p06.webp?v=ccab6327)
- 在沙盒中打开: https://postext.dev/zh/sandbox#recipe=homer-polytonic-facing-translation&lang=en (.postext: https://postext.dev/cookbook/homer-polytonic-facing-translation/en/homer-polytonic-facing-translation.postext)
- 最后更新: 2026-11-29
- 其他语言: [en](https://postext.dev/en/cookbook/homer-polytonic-facing-translation.md), [es](https://postext.dev/es/cookbook/homer-polytonic-facing-translation.md), [ca](https://postext.dev/ca/cookbook/homer-polytonic-facing-translation.md), [de](https://postext.dev/de/cookbook/homer-polytonic-facing-translation.md), [el](https://postext.dev/el/cookbook/homer-polytonic-facing-translation.md), [fr](https://postext.dev/fr/cookbook/homer-polytonic-facing-translation.md), [it](https://postext.dev/it/cookbook/homer-polytonic-facing-translation.md), [pt](https://postext.dev/pt/cookbook/homer-polytonic-facing-translation.md), [ja](https://postext.dev/ja/cookbook/homer-polytonic-facing-translation.md), [ar](https://postext.dev/ar/cookbook/homer-polytonic-facing-translation.md)

## 简单来说

荷马《奥德赛》开头几行古希腊语原文，带全部重音和气符，排在左页；右页是现代希腊语诗体译文，每行与所译的原文对齐。

## 成品一览

一本14 × 21.5 cm的小型古典文本，用GFS Didot排，这是希腊字体协会的多调字体。开头一页是拜占庭时代的《荷马传》，《苏达辞书》把它归在米利都的Hesychius名下，附荷马在伊奥斯岛的墓志铭。接着是两个对页：左页是《奥德赛》第一卷第1至27行，右页是Argyris Eftaliotis用十五音节诗行写的现代希腊语译文，逐行对应，每五行在外侧页边标号。三份文本都属公有领域，取自希腊语维基文库。书眉和章首把标题排成大写，去掉所有气符和重音。

**这份食谱回答的问题:**

- 怎样排多调古希腊语，带断词和行号，并与译文对照？
- 怎样在诗的页边每隔五行标一个行号，并让注释对应这些行号？
- 怎样排诗歌：每句一行，诗节间留空，折行悬挂缩进，不断词？
- 怎样让西班牙文、法文或德文获得良好的两端对齐和断词？

## 简短回答

```js
// script.js, 行 31–51
// locale 'grc' takes the polytonic patterns, which read breathings, circumflexes, the iota
// subscript and the diaeresis as the letters they sit on (Πει-σι-στρά-του, ὀφ-θαλ-μῶν,
// ἀ-ναμ-φί-λε-κτα). Eftaliotis's modern Greek is written polytonic too; under 'el' a
// polytonic word would be divided by the same patterns, so the two pages hyphenate alike.
// The labels are the modern Greek ones (Εικόνα, Πίνακας), as for 'el'.
const LOCALE = 'grc';
// Fontsource cuts each face into files by script, and loadFonts adds latin and greek. The
// accented letters of polytonic Greek (ἀ ὃ ῷ, U+1F00–1FFF) are in a third file, greek-ext:
// each face takes it too before the build, so no letter falls to a system font.
async function loadGreekExtended(faces) {
  const jobs = Object.entries(faces).flatMap(([family, specs]) => specs.map(async (spec) => {
    const id = fontsourceId(family);
    const style = spec.endsWith('i') ? 'italic' : 'normal';
    const file = `${id}-greek-ext-${parseInt(spec, 10)}-${style}.woff2`;
    const url = `${await fontsourceAt(id)}files/${file}`;
    const face = new FontFace(family, `url(${url}) format('woff2')`,
      { weight: String(parseInt(spec, 10)), style, unicodeRange: 'U+1F00-1FFF' });
    document.fonts.add(await face.load());
  }));
  await Promise.all(jobs);
}
```

## 用料

**讲解**

- [断词与文档语言](https://postext.dev/zh/docs/justification.md#支持的语言): 基于TeX模式的九种语言断词（包括希腊语），由文档的locale选择；locale同时决定表格续表字样和带标签PDF的语言。
- [行号](https://postext.dev/zh/docs/configuration-notes-references.md#行号): lineNumbers在页边、栏间或边栏中为每第五行（或每第N行）印出行号：可数:::verse诗中的诗行，也可数正文的每一行；计数在每首诗、每页、每章或每节重新开始，或贯穿全书，不移动任何一行。
- [逐行排诗](https://postext.dev/zh/docs/document-format-directives.md#verse): :::verse按书写原样排诗：Markdown的一行就是一行诗，诗节之间空行，行首空格为缩进；过长的诗行以悬挂缩进转行，或在方括号后靠右排，分页时绝不与本行分开，短诗节可以保持完整。

**还用到**

- [排版前加载字体](https://postext.dev/zh/docs/configuration-programmatic-usage.md#排版前加载字体)
- [标题样式](https://postext.dev/zh/docs/configuration-styles.md#标题样式)
- [标题属性](https://postext.dev/zh/docs/document-format.md#标题属性)
- [设计过的章首页](https://postext.dev/zh/docs/configuration-headings.md#通栏与高级设计)
- [页面设计中的文字、线条和框](https://postext.dev/zh/docs/configuration-headers-footers.md#页眉与页脚)
- [书眉与页码](https://postext.dev/zh/docs/configuration-headers-footers.md#页眉与页脚)
- [按页面角色显示书眉](https://postext.dev/zh/docs/configuration-headers-footers.md#文本元素)
- [换页与换栏](https://postext.dev/zh/docs/document-format-directives.md#pagebreak)
- [对称页边距](https://postext.dev/zh/docs/configuration-page-layout.md#对称页边距)
- [纸张颜色](https://postext.dev/zh/docs/configuration-page-layout.md#页面)
- [段落样式](https://postext.dev/zh/docs/configuration-styles.md#段落样式)
- [文档元数据](https://postext.dev/zh/docs/document-format.md#前置元数据)
- [语义调色板](https://postext.dev/zh/docs/configuration-fonts-colors-viewers.md#调色板)
- [在Canvas上绘制页面](https://postext.dev/zh/docs/configuration-programmatic-usage.md#把页面渲染为位图)
- [参考文献与术语表](https://postext.dev/zh/docs/configuration-styles.md#段落样式)
- [分节书眉](https://postext.dev/zh/docs/configuration-styles.md#标题样式)

**配置一览**

- [`bodyText`](https://postext.dev/zh/docs/configuration-text.md#正文), [`colorPalette`](https://postext.dev/zh/docs/configuration-fonts-colors-viewers.md#调色板), [`footer`](https://postext.dev/zh/docs/configuration-headers-footers.md#页眉与页脚), [`header`](https://postext.dev/zh/docs/configuration-headers-footers.md#页眉与页脚), [`headingStyles`](https://postext.dev/zh/docs/configuration-styles.md#标题样式), [`headings`](https://postext.dev/zh/docs/configuration-headings.md#标题), [`layout`](https://postext.dev/zh/docs/configuration-page-layout.md#版式), [`lineNumbers`](https://postext.dev/zh/docs/configuration-notes-references.md#行号), [`locale`](https://postext.dev/zh/docs/configuration-language.md#断词), [`page`](https://postext.dev/zh/docs/configuration-page-layout.md#页面), [`paragraphStyles`](https://postext.dev/zh/docs/configuration-styles.md#段落样式)

**API**

- [`buildDocumentWithFonts`](https://postext.dev/zh/docs/configuration-programmatic-usage.md#排版前加载字体), [`renderPageToCanvas`](https://postext.dev/zh/docs/configuration-programmatic-usage.md#把页面渲染为位图)

**字体**

- GFS Didot (OFL-1.1)

## 做法

### 1 · 把文本标为grc并加载带重音的字母

代码就是上面的[简短回答](https://postext.dev/zh/cookbook/homer-polytonic-facing-translation.md#简短回答)。`locale: 'grc'`选用多调断词模式（[断词](https://postext.dev/zh/docs/configuration-language.md)），把气符、扬抑符、下标iota或分音符当作所在字母的一部分。第1页断成Βατρα-χομυομαχία、ἐπι-δειξάμενος和τυράν-νου。Fontsource按文字系统拆分每款字体，`loadFonts`只加入latin和greek文件。预组合的多调字母U+1F00–1FFF在第三个文件greek-ext里，由`loadGreekExtended`在排版前为每款字体加入。要在`loadFonts`之后调用，否则引擎会认为字体已加载而跳过greek文件。

### 2 · 在外侧页边每五行标号

```js
// script.js, 行 67–73
// Each page of verse is its own :::verse block. The Greek and the translation of a spread
// both open with {lineStart=11}, so the numbers on the two pages agree: restart 'poem'
// counts each block from its own start, and the epitaph, {numbered=false}, is not counted.
const lineNumbers = {
  enabled: true, count: 'verse', interval: 5, restart: 'poem', position: 'outer',
  gap: mm(6), fontFamily: DIDOT, fontSize: em(0.8), color: col('rubric'),
};
```

`count: 'verse'`只给诗行编号，`restart: 'poem'`让每个`:::verse`块从自己的起点计数。每页诗行是单独的一块。第二个对页的原文和译文都以`{lineStart=11}`开头，所以对页上的行号一致。`position: 'outer'`把行号放在左页的左边、右页的右边（[行号](https://postext.dev/zh/docs/configuration-text.md)）。墓志铭用`{numbered=false}`，不编号。

### 3 · 大写的章首和书眉

```js
// script.js, 行 83–124
// textTransform 'uppercase' turns Ὀδύσσεια into ΟΔΥΣΣΕΙΑ and Ῥαψῳδία into ΡΑΨΩΔΙΑ: Greek
// capitals take no breathing, no accent and no iota subscript (a dialytika stays, Ϊ Ϋ).
const caps = (size, tracking, color = 'muted') => ({ fontFamily: DIDOT, fontSize: pt(size),
  letterSpacing: pt(tracking), textTransform: 'uppercase', color: col(color) });
const opener = (title) => ({ enabled: true, minHeight: pt(5 * LEAD), slot: { elements: [
  { kind: 'text', id: 'kicker', content: '{attr.kicker}', align: 'center', ...caps(8, 2, 'rubric'),
    placement: { ...at('container', 'top', 0, LINE), size: { width: 'fill' } } },
  { kind: 'text', id: 'title', content: title, align: 'center', ...caps(17, 3.5, 'ink'),
    placement: { ...at('container', 'top', 0, 2.2 * LINE), size: { width: 'fill' } } },
] } });
// # Ὀδύσσεια {style="original"} opens a verso, {style="translation"} the recto facing it;
// a style sets its own break side (gotcha: style-inherits-break).
const headingStyles = [
  { id: 'original', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'translation', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'life', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: { enabled: true, minHeight: pt(6 * LEAD), slot: { elements: [
      { kind: 'text', id: 'title', content: '{titleText}', align: 'center', ...caps(15, 3, 'ink'),
        placement: { ...at('container', 'top', 0, 1.6 * LINE), size: { width: 'fill' } } },
      { kind: 'text', id: 'source', content: '{attr.source}', align: 'center', fontFamily: DIDOT,
        fontSize: pt(10), color: col('muted'),
        placement: { ...at('container', 'top', 0, 3.2 * LINE), size: { width: 'fill' } } },
    ] } } },
  { id: 'note-page', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(LEAD),
    header: { elements: [] }, advancedDesign: { enabled: true, minHeight: pt(3 * LEAD),
      slot: { elements: [{ kind: 'text', id: 'label', content: '{titleText}', align: 'center',
        ...caps(7.5, 1.6, 'rubric'), placement: { ...at('container', 'top', 0, LINE),
          size: { width: 'fill' } } }] } } },
];
// The author and the title over the versos, the translator over the rectos; folios outside.
const head = (id, content, parity, edge, x, extra = {}) => ({ kind: 'text', id, content, parity,
  pages: 'body', ...caps(7.5, 1.5), ...extra, placement: at('page', edge, x, 12) });
const folio = { textTransform: 'none', letterSpacing: pt(0), fontSize: pt(9), color: col('ink') };
const SHIFT = (INNER - OUTER) / 2; // mm: the text block's centre is off the page's centre
const header = { elements: [
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
  head('verso-head', '{author} · {title}', 'even', 'top', -SHIFT),
  head('recto-head', '{subtitle}', 'odd', 'top', SHIFT),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };
```

`textTransform: 'uppercase'`把Ὀδύσσεια排成ΟΔΥΣΣΕΙΑ，把Ῥαψῳδία排成ΡΑΨΩΔΙΑ：希腊语大写不带气符、重音和下标iota，引擎排字时去掉它们。`original`样式让原文从左页开始，`translation`让译文在对面的右页开始。`:::pagebreak{parity="even"}`和`{parity="odd"}`对第二个对页做同样的事。标题文字和PDF文字保持原样，所有符号都在。

## 完整食谱

一个文件，由食谱文件夹合成，示例文本和排版食谱的公共工具包都已内联；它自己排出页面。要运行它，把它放进空白页面的`<script type="module">`，或粘贴到新建CodePen的JS面板里（设为模块）。它从esm.sh导入postext，不需要安装或构建。

- 食谱文件夹: https://github.com/drnachio/postext/tree/main/cookbook/homer-polytonic-facing-translation

### script.js

```js
// ═══ Postext Cookbook · Nº 202 · Homer in polytonic Greek, facing its translation ═══════
// https://postext.dev/en/cookbook/homer-polytonic-facing-translation
// Code: MIT · Texts: Homer, Hesychius, A. Eftaliotis (PD, el.wikisource) · Pictures: none
// Fonts: GFS Didot (SIL OFL 1.1) · Needs postext ≥ 1.99.1
// The opening of the Odyssey on the versos, Eftaliotis's line-for-line modern Greek on the
// rectos, both numbered every fifth line, after a page of the Byzantine Life of Homer.
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';

const LANG = 'en'; // @lang: the language of the note on the text ('en' | 'es' | 'el')
const RECIPE = 'homer-polytonic-facing-translation';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black text on a warm white, and the dull red of a classical text's rubrics.
const palette = {
  ink: '#1c1a18', // the texts
  rubric: '#8c2f23', // line numbers, headings, rules
  muted: '#6b6359', // running heads, the note on the text, the colophon
  paper: '#fcfaf5',
};
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: 'rubric (defaults)', value: { hex: palette.rubric, model: 'hex' } },
];
const DIDOT = 'GFS Didot'; // the Greek Font Society's Didot: polytonic, with its own Latin
const [BODY, LEAD] = [10.2, 15]; // pt
const LINE = (LEAD * 25.4) / 72; // mm: one line, 5.29
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });

// #region answer: Ancient Greek is 'grc', with the polytonic accents written in the text
// locale 'grc' takes the polytonic patterns, which read breathings, circumflexes, the iota
// subscript and the diaeresis as the letters they sit on (Πει-σι-στρά-του, ὀφ-θαλ-μῶν,
// ἀ-ναμ-φί-λε-κτα). Eftaliotis's modern Greek is written polytonic too; under 'el' a
// polytonic word would be divided by the same patterns, so the two pages hyphenate alike.
// The labels are the modern Greek ones (Εικόνα, Πίνακας), as for 'el'.
const LOCALE = 'grc';
// Fontsource cuts each face into files by script, and loadFonts adds latin and greek. The
// accented letters of polytonic Greek (ἀ ὃ ῷ, U+1F00–1FFF) are in a third file, greek-ext:
// each face takes it too before the build, so no letter falls to a system font.
async function loadGreekExtended(faces) {
  const jobs = Object.entries(faces).flatMap(([family, specs]) => specs.map(async (spec) => {
    const id = fontsourceId(family);
    const style = spec.endsWith('i') ? 'italic' : 'normal';
    const file = `${id}-greek-ext-${parseInt(spec, 10)}-${style}.woff2`;
    const url = `${await fontsourceAt(id)}files/${file}`;
    const face = new FontFace(family, `url(${url}) format('woff2')`,
      { weight: String(parseInt(spec, 10)), style, unicodeRange: 'U+1F00-1FFF' });
    document.fonts.add(await face.load());
  }));
  await Promise.all(jobs);
}
// #endregion

// #region page: a 14 × 21.5 cm classical text, 28 lines of 15 pt
const TRIM = { width: 140, height: 215 }; // mm
const [TOP, INNER, OUTER, LINES] = [22, 16, 21, 28];
const page = {
  width: mm(TRIM.width), height: mm(TRIM.height), dpi: 150, backgroundColor: col('paper'),
  margins: { top: mm(TOP), bottom: mm(TRIM.height - TOP - LINES * LINE),
    left: mm(INNER), right: mm(OUTER), mirror: true },
};
// 103 mm of measure: the longest line of Eftaliotis, 59 letters, sets in 97 mm at 10.2 pt,
// so no line turns over and the two pages of a spread keep their lines level.
// #endregion

// #region lines: every fifth line numbered at the outer edge, the count kept by each page
// Each page of verse is its own :::verse block. The Greek and the translation of a spread
// both open with {lineStart=11}, so the numbers on the two pages agree: restart 'poem'
// counts each block from its own start, and the epitaph, {numbered=false}, is not counted.
const lineNumbers = {
  enabled: true, count: 'verse', interval: 5, restart: 'poem', position: 'outer',
  gap: mm(6), fontFamily: DIDOT, fontSize: em(0.8), color: col('rubric'),
};
// #endregion

// #region verse: hexameters and fifteen-syllable lines, centred on the longest
// A blank space in the source would start a stanza: neither text has any, so each block
// is one run of lines. A line too long for the measure would turn over and hang 2 em in.
const verseStyle = { id: 'verse', hangingIndent: em(2) };
// #endregion

// #region heads: kicker and title in capitals, which drop breathings and accents
// textTransform 'uppercase' turns Ὀδύσσεια into ΟΔΥΣΣΕΙΑ and Ῥαψῳδία into ΡΑΨΩΔΙΑ: Greek
// capitals take no breathing, no accent and no iota subscript (a dialytika stays, Ϊ Ϋ).
const caps = (size, tracking, color = 'muted') => ({ fontFamily: DIDOT, fontSize: pt(size),
  letterSpacing: pt(tracking), textTransform: 'uppercase', color: col(color) });
const opener = (title) => ({ enabled: true, minHeight: pt(5 * LEAD), slot: { elements: [
  { kind: 'text', id: 'kicker', content: '{attr.kicker}', align: 'center', ...caps(8, 2, 'rubric'),
    placement: { ...at('container', 'top', 0, LINE), size: { width: 'fill' } } },
  { kind: 'text', id: 'title', content: title, align: 'center', ...caps(17, 3.5, 'ink'),
    placement: { ...at('container', 'top', 0, 2.2 * LINE), size: { width: 'fill' } } },
] } });
// # Ὀδύσσεια {style="original"} opens a verso, {style="translation"} the recto facing it;
// a style sets its own break side (gotcha: style-inherits-break).
const headingStyles = [
  { id: 'original', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'translation', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'life', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: { enabled: true, minHeight: pt(6 * LEAD), slot: { elements: [
      { kind: 'text', id: 'title', content: '{titleText}', align: 'center', ...caps(15, 3, 'ink'),
        placement: { ...at('container', 'top', 0, 1.6 * LINE), size: { width: 'fill' } } },
      { kind: 'text', id: 'source', content: '{attr.source}', align: 'center', fontFamily: DIDOT,
        fontSize: pt(10), color: col('muted'),
        placement: { ...at('container', 'top', 0, 3.2 * LINE), size: { width: 'fill' } } },
    ] } } },
  { id: 'note-page', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(LEAD),
    header: { elements: [] }, advancedDesign: { enabled: true, minHeight: pt(3 * LEAD),
      slot: { elements: [{ kind: 'text', id: 'label', content: '{titleText}', align: 'center',
        ...caps(7.5, 1.6, 'rubric'), placement: { ...at('container', 'top', 0, LINE),
          size: { width: 'fill' } } }] } } },
];
// The author and the title over the versos, the translator over the rectos; folios outside.
const head = (id, content, parity, edge, x, extra = {}) => ({ kind: 'text', id, content, parity,
  pages: 'body', ...caps(7.5, 1.5), ...extra, placement: at('page', edge, x, 12) });
const folio = { textTransform: 'none', letterSpacing: pt(0), fontSize: pt(9), color: col('ink') };
const SHIFT = (INNER - OUTER) / 2; // mm: the text block's centre is off the page's centre
const header = { elements: [
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
  head('verso-head', '{author} · {title}', 'even', 'top', -SHIFT),
  head('recto-head', '{subtitle}', 'odd', 'top', SHIFT),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };
// #endregion

const config = () => ({
  locale: LOCALE, // written out, never LANG: the texts are Greek in every edition
  colorPalette, page, lineNumbers, header, headingStyles, footer: { elements: [] },
  layout: { layoutType: 'single' }, // the default is two columns
  bodyText: {
    fontFamily: DIDOT, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
    boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
    firstLineIndent: em(1.5), indentAfterHeading: false, hyphenateAcrossColumns: false,
    maxWordSpacing: 1.6, minWordSpacing: 0.8, maxJustifyTracking: 10,
    verse: { indentStep: em(1) },
  },
  headings: { fontFamily: DIDOT, fontWeight: 400,
    levels: [{ level: 1, breakBefore: { enabled: true, parity: 'any' } }] },
  paragraphStyles: [verseStyle,
    // The note is in the edition's language, hyphenated with that language's patterns.
    { id: 'note', fontSize: pt(9), lineHeight: pt(13), color: col('muted'),
      italicColor: col('muted'), firstLineIndent: em(1.5), hyphenation: { locale: LANG } },
    { id: 'colophon', fontSize: pt(7.5), lineHeight: pt(10), color: col('muted'),
      textAlign: 'center', firstLineIndent: pt(0), marginTop: pt(LEAD),
      hyphenation: { enabled: false } },
  ],
});

// ─── 2 · Content ────────────────────────────────────────────────────────────
// The Life and the two spreads of verse (content.text.<lang>.md), then the note on the text
// in the edition's language (content.<lang>.md).
const markdown = [String.raw`---
title: "Ὀδύσσεια"
author: "Ὅμηρος"
subtitle: "Μετάφραση Ἀργύρη Ἐφταλιώτη"
---

# Βίος Ὁμήρου {style="life" source="Ἡσυχίου τοῦ Μιλησίου, ἐκ τῆς Σούδας"}

ποιήματα δ’ αὐτοῦ ἀναμφίλεκτα Ἰλιὰς καὶ Ὀδύσσεια. ἔγραψε δὲ τὴν Ἰλιάδα οὐχ ἅμα οὐδὲ κατὰ τὸ συνεχές, καθάπερ σύγκειται, ἀλλ’ αὐτὸς μὲν ἑκάστην ῥαψῳδίαν γράψας καὶ ἐπιδειξάμενος ἐν τῷ περινοστεῖν τὰς πόλεις τροφῆς ἕνεκεν ἀπέλιπεν. ὕστερον δὲ συνετέθη καὶ συνετάχθη ὑπὸ πολλῶν καὶ μάλιστα ὑπὸ Πεισιστράτου τοῦ τῶν Ἀθηναίων τυράννου. ἀναφέρεται δὲ εἰς αὐτὸν καὶ ἄλλα τινὰ ποιήματα, Ἀμαζονία, Ἰλιὰς μικρά, Νόστοι, Ἐπικιχλίδες, Ἠθιέπακτος ἤτοι Ἴαμβοι, Βατραχομυομαχία, Ἀραχνομαχία, Γερανομαχία, Κεραμίς, Ἀμφιαράου ἐξέλασις, παίγνια, Οἰχαλίας ἅλωσις, Ἐπιθαλάμια, Κύκλος, Ὕμνοι, Κύπρια.

γηραιὸς δὲ τελευτήσας ἐν τῇ νήσῳ τῇ Ἴῳ τέθαπται, τυφλὸς ἐκ παίδων γεγονώς, τὸ δ’ ἀληθὲς ὅτι οὐχ ἡττήθη ἐπιθυμίας, ἣ διὰ τῶν ὀφθαλμῶν ἄρχεται· καὶ παρὰ τοῦτο ἱστορήθη τυφλός. ἐπιγέγραπται δ’ ἐν τῷ τάφῳ αὐτοῦ τόδε τὸ ἐλεγεῖον, ὃ ὑπὸ τῶν Ἰητῶν ἐποιήθη χρόνῳ·

:::verse{numbered=false}
ἐνθάδε τὴν ἱερὰν κεφαλὴν κατὰ γαῖα καλύπτει,
ἀνδρῶν ἡρώων κοσμήτορα, θεῖον Ὅμηρον.
:::

# Ὀδύσσεια {style="original" kicker="Ῥαψῳδία α"}

:::verse
Ἄνδρα μοι ἔννεπε, Μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσε·
πολλῶν δ’ ἀνθρώπων ἴδεν ἄστεα καὶ νόον ἔγνω,
πολλὰ δ’ ὅ γ’ ἐν πόντῳ πάθεν ἄλγεα ὃν κατὰ θυμόν,
ἀρνύμενος ἥν τε ψυχὴν καὶ νόστον ἑταίρων.
ἀλλ’ οὐδ’ ὣς ἑτάρους ἐρρύσατο, ἱέμενός περ·
αὐτῶν γὰρ σφετέρῃσιν ἀτασθαλίῃσιν ὄλοντο,
νήπιοι, οἳ κατὰ βοῦς Ὑπερίονος Ἠελίοιο
ἤσθιον· αὐτὰρ ὁ τοῖσιν ἀφείλετο νόστιμον ἦμαρ.
τῶν ἁμόθεν γε, θεά, θύγατερ Διός, εἰπὲ καὶ ἡμῖν.
:::

# Ὀδύσσεια {style="translation" kicker="Μετάφραση Ἀργύρη Ἐφταλιώτη"}

:::verse
Τὸν ἄντρα τὸν πολύπραγο τραγούδησέ μου, ὦ Μοῦσα,
ποὺ περισσὰ πλανήθηκε, σὰν κούρσεψε τῆς Τροίας
τὸ ἱερὸ κάστρο, καὶ πολλῶν ἀνθρώπων εἶδε χῶρες
κι ἔμαθε γνῶμες, καὶ πολλὰ στὰ πέλαα βρῆκε πάθια,
γιὰ μιὰ ζωὴ παλεύοντας καὶ γυρισμὸ συντρόφων.
Μὰ πάλε δὲν τοὺς γλύτωσε, κι ἂν τὸ ποθοῦσε, ἐκείνους,
τὶ ἀπὸ δική τους χάθηκαν οἱ κούφιοι ἀμυαλωσύνη,
τοῦ Ἥλιου τοῦ Ὑπερίονα σὰν ἔφαγαν τὰ βόδια,
κι αὐτὸς τοὺς πῆρε τὴ γλυκειὰ τοῦ γυρισμοῦ τους μέρα.
Ἀπ’ ὅπου ἂν τά ’χης, πές μας τα, ὦ θεά, τοῦ Δία κόρη.
:::

:::pagebreak{parity="even"}

:::verse{lineStart=11}
ἔνθ’ ἄλλοι μὲν πάντες, ὅσοι φύγον αἰπὺν ὄλεθρον,
οἴκοι ἔσαν, πόλεμόν τε πεφευγότες ἠδὲ θάλασσαν·
τὸν δ’ οἶον, νόστου κεχρημένον ἠδὲ γυναικός,
νύμφη πότνι’ ἔρυκε Καλυψώ, δῖα θεάων,
ἐν σπέεσι γλαφυροῖσι, λιλαιομένη πόσιν εἶναι.
ἀλλ’ ὅτε δὴ ἔτος ἦλθε περιπλομένων ἐνιαυτῶν,
τῷ οἱ ἐπεκλώσαντο θεοὶ οἶκόνδε νέεσθαι
εἰς Ἰθάκην, οὐδ’ ἔνθα πεφυγμένος ἦεν ἀέθλων
καὶ μετὰ οἷσι φίλοισι· θεοὶ δ’ ἐλέαιρον ἅπαντες
νόσφι Ποσειδάωνος· ὁ δ’ ἀσπερχὲς μενέαινεν
ἀντιθέῳ Ὀδυσῆϊ πάρος ἣν γαῖαν ἱκέσθαι.
ἀλλ’ ὁ μὲν Αἰθίοπας μετεκίαθε τηλόθ’ ἐόντας,
Αἰθίοπας, τοὶ διχθὰ δεδαίαται, ἔσχατοι ἀνδρῶν,
οἱ μὲν δυσομένου Ὑπερίονος, οἱ δ’ ἀνιόντος,
ἀντιόων ταύρων τε καὶ ἀρνειῶν ἑκατόμβης.
ἔνθ’ ὅ γε τέρπετο δαιτὶ παρήμενος· οἱ δὲ δὴ ἄλλοι
Ζηνὸς ἐνὶ μεγάροισιν Ὀλυμπίου ἁθρόοι ἦσαν.
:::

:::pagebreak{parity="odd"}

:::verse{lineStart=11}
Ὅλοι ποὺ τότες τὸν πολὺ τὸ χαλασμὸ ξεφύγαν
γυρίσανε, ἀπὸ πόλεμο καὶ θάλασσα σωσμένοι,
καὶ μόνο ἐκειόνε, σπιτικὸ καὶ ταίρι στερημένο,
ἡ Καλυψὼ ἡ τρισέμορφη θεὰ τόνε κρατοῦσε,
γιατὶ ἄντρα της τὸν ἤθελε στὶς βαθουλὲς σπηλιές της.
Μὰ ὁ γῦρος σὰν τελέστηκε τῶν χρόνων, κι ἦρθε ἡ ὥρα,
ποὺ τό ’χανε οἱ θεοὶ γραφτὸ στὸ Θιάκι νὰ ξανάρθη
στὸ σπιτικό του, μήτ’ ἐκεῖ δὲν τοῦ ’λειψαν οἱ ἀγῶνες,
καὶ σὲ δικοὺς κοντά. Κι οἱ θεοὶ τὸν συμπονοῦσαν ὅλοι,
ἐξὸν τὸν Ποσειδώνα· αὐτὸς βαριὰ ἦταν χολωμένος
μὲ τὸ Δυσσέα τὸ θεϊκό, στὸν τόπο του πρὶν φτάση.
Βρισκόταν στοὺς Αἰθίοπες ὁ Ποσειδώνας τότες,
ποὺ ζοῦνε μοιραστοὶ μακριὰ στοῦ κόσμου τὶς ἀκροῦλες,
στοῦ Ἡλιοῦ τὸ βούλημα οἱ μισοί, στ’ ἀνάβλεμμά του οἱ ἄλλοι,
γιὰ νὰ δεχτῆ ἑκατοβοδιὰ ἀπὸ ταύρους καὶ κριάρια.
Ἐκεῖ γλυκοξεφάντωνε· οἱ θεοὶ ὡς τόσο οἱ ἄλλοι
στοὺς πύργους μαζωχτήκανε τοῦ Δία τοῦ Ὀλυμπήσου,
:::
`, String.raw`# A note on the text {style="note-page"}

:::paragraphs{style="note"}
The opening of the Odyssey, lines 1–27 of Book I, faces the modern Greek of Argyris Eftaliotis (1849–1923), who rendered Homer line for line in the fifteen-syllable verse of the folk songs, so that each line of the translation stands level with its original. Both are polytonic: the Homer in the text of Greek Wikisource, the translation in Eftaliotis’s own spelling, from the same library, with one accent corrected. Before them stand the last two sections of the Life of Homer that the Suda keeps from Hesychius of Miletus (ed. A. Westermann, 1845), with four slips corrected, and the epitaph on Homer’s grave on Ios.
:::

:::paragraphs{style="colophon"}
Set in GFS Didot (SIL OFL) · Texts: Homer, Hesychius and A. Eftaliotis, public domain, from el.wikisource
:::
`].join('\n\n');

// ─── 3 · Fonts ──────────────────────────────────────────────────────────────
const FONTS = { 'GFS Didot': ['400'] }; // DIDOT: every text on the pages; it has one weight

// ─── 4 · Build & show ───────────────────────────────────────────────────────
await loadFonts(FONTS, markdown); // latin and greek
await loadGreekExtended(FONTS); // and the polytonic letters
const doc = await buildDocumentWithFonts({ markdown }, config(), kitFonts(FONTS));
showPages(doc, { title: 'Ὀδύσσεια · Ῥαψῳδία α' });

// ─── Kit ── helpers shared by every Cookbook recipe · postext.dev/cookbook ─────

// ─── Kit · core v1 ── the same in every recipe · postext.dev/cookbook
function mm(value) { return { value, unit: 'mm' }; }
function pt(value) { return { value, unit: 'pt' }; }
function em(value) { return { value, unit: 'em' }; }
/** The sample language's string: t({ en: 'Figure', es: 'Figura' }). */
function t(strings) { return strings[LANG] ?? Object.values(strings)[0]; }
/** A file in this recipe's assets folder, served from the Postext repo by jsDelivr. */
function asset(file) { return `https://cdn.jsdelivr.net/gh/drnachio/postext@main/cookbook/${RECIPE}/assets/${file}`; }

// ─── Kit · fonts v3 ── the same in every recipe · postext.dev/cookbook
// Postext loads the faces a config asks for before layout and asks the kit
// for Fontsource's files, the ones the PDF embeds too.

/** buildDocumentWithFonts' options: the resolver, and FONTS' faces loaded
 *  with the config's. FONTS = { 'Family Name': ['400', '400i', '700'] }. */
function kitFonts(FONTS = {}) {
  const faces = Object.entries(FONTS).flatMap(([family, specs]) => specs.map((spec) =>
    ({ family, weight: parseInt(spec, 10), style: spec.endsWith('i') ? 'italic' : 'normal' })));
  return { resolve: fontsourceResolver, faces };
}

/** A face's files with their ranges: latin, then latin-ext and greek when
 *  `text` needs them (kitSubsetsFor). Null for a face Fontsource lacks. */
async function fontsourceResolver(family, weight, style, { text = '' } = {}) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  if (meta && !(await fontsourceWeights(family, style)).includes(weight)) return null;
  kitStatus('Loading fonts…');
  const at = await fontsourceAt(id);
  return ['latin', ...kitSubsetsFor(text, meta)].map((subset) => ({
    source: `${at}files/${id}-${subset}-${weight}-${style}.woff2`,
    unicodeRange: kitRanges()[subset],
  }));
}

/** Each file's unicode-range (a function: the kit runs after the pen's code). */
function kitRanges() {
  return {
    latin: 'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,'
      + 'U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
    'latin-ext': 'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,'
      + 'U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF',
    greek: 'U+0370-03FF',
  };
}

/** For the cjk, arabic and comics blocks: loads `faces` (as FONTS) for the
 *  sample `text`; `optional` skips a face Fontsource lacks. Files are added in
 *  the order asked, the last winning a shared character. Resolves to the count. */
async function loadFonts(faces, text = '', { optional = false } = {}) {
  kitStatus('Loading fonts…');
  const ranges = kitRanges();
  const jobs = [];
  for (const [family, specs] of Object.entries(faces)) {
    const id = fontsourceId(family);
    const todo = [...new Set(specs)].map((spec) => [parseInt(spec, 10), spec.endsWith('i') ? 'italic' : 'normal'])
      .filter(([weight, style]) => !hasFace(family, weight, style)); // before any await
    const at = fontsourceAt(id);
    const meta = optional || /[^\0-ÿ]/u.test(text) ? await fontsourceMeta(family) : null;
    const subsets = ['latin', ...kitSubsetsFor(text, meta)];
    for (const [weight, style] of todo) {
      if (optional && !(meta && (await fontsourceWeights(family, style)).includes(weight))) continue;
      for (const subset of subsets) {
        const url = `${await at}files/${id}-${subset}-${weight}-${style}.woff2`;
        const face = new FontFace(family, `url(${url}) format('woff2')`,
          { weight: String(weight), style, unicodeRange: ranges[subset] });
        jobs.push(face.load().catch(() => {
          if (subset === 'latin' && !optional) throw new Error(`Fontsource has no ${family} ${weight} ${style}`);
        }));
      }
    }
  }
  const ready = await Promise.all(jobs).catch((error) => { kitFail(error); throw error; });
  return ready.filter((face) => face && document.fonts.add(face)).length;
}

/** A loaded FontFace covers this face (fonts.check() says yes to any family). */
function hasFace(family, weight, style) {
  for (const face of document.fonts) {
    if (face.status !== 'loaded' || face.style !== style) continue;
    if (face.family.replace(/^["']|["']$/g, '') !== family) continue;
    const [low, high = low] = face.weight.split(' ').map(Number);
    if (weight >= low && weight <= high) return true;
  }
  return false;
}

/** The files beyond latin `text` needs that `meta`'s family ships. */
function kitSubsetsFor(text, meta) {
  return [[/[Ā-˿ᴀ-ᶿḀ-ỿ†ℓⱠ-Ɀ꜠-ꟿ]/u, 'latin-ext'], [/[Ͱ-Ͽ]/u, 'greek']]
    .filter(([re, x]) => re.test(text) && meta?.subsets?.includes(x)).map(([, x]) => x);
}

/** Fontsource's id for a family: 'Source Serif 4' → 'source-serif-4'. */
function fontsourceId(family) { return family.toLowerCase().replace(/\s+/g, '-'); }

/** A package's folder at the one version @5 names now (#766). */
function fontsourceAt(id, u = `https://cdn.jsdelivr.net/npm/@fontsource/${id}@`) {
  return (fontsourceAt.c ??= {})[id] ??= fetch(u + '5/package.json').then((r) => r.json())
    .then((p) => p.version || 5, () => 5).then((v) => `${u}${v}/`);
}

/** The family's Fontsource metadata (weights, styles, subsets), or null. */
function fontsourceMeta(family, id = fontsourceId(family)) {
  return (fontsourceMeta.c ??= {})[id] ??= fetch(`https://api.fontsource.org/v1/fonts/${id}`)
    .then((res) => (res.ok ? res.json() : null), () => null);
}

/** The weights the package ships in `style`: the API pairs none (no Libre
 *  Caslon 700 italic file), so italics are read from latin-italic.css. */
function fontsourceWeights(family, style, id = fontsourceId(family)) {
  return (fontsourceWeights.c ??= {})[id + style] ??= fontsourceMeta(family).then(async (m) => {
    if (!m?.styles.includes(style)) return m ? [] : [400, 700];
    const css = style === 'italic' ? await fetch(`${await fontsourceAt(id)}latin-italic.css`).then((r) => (r.ok ? r.text() : ''), () => '') : '';
    const w = [...css.matchAll(/weight: (\d+)/g)].map((x) => +x[1]);
    return w.length ? w : m.weights;
  });
}

// ─── Kit · viewer v2 ── the same in every recipe · postext.dev/cookbook
/** The pages as spreads on a dark desk, page 1 alone, then verso | recto,
 *  each painted when it scrolls near. Other options go to renderPageToCanvas. */
function showPages(docs, { title, width = 460, ...render } = {}) {
  const root = viewer(title);
  const pages = [docs].flat().flatMap((doc) =>
    doc.pages.map((page) => ({ doc, page, n: (doc.pageIndexOffset ?? 0) + page.index })));
  const spreads = [];
  let verso = null;
  for (const p of pages) {
    if (p.n % 2 === 1) { if (verso) spreads.push([verso, null]); verso = p; }
    else { spreads.push([verso, p]); verso = null; }
  }
  if (verso) spreads.push([verso, null]);
  const density = Math.min(window.devicePixelRatio || 1, 2);
  showPages.painter?.disconnect();
  const painter = new IntersectionObserver((entries) => {
    for (const { isIntersecting, target } of entries) {
      if (!isIntersecting) continue;
      painter.unobserve(target);
      const { doc, page } = target.postext;
      renderPageToCanvas(page, doc, target, { ...render, scale: (width * density) / page.width });
    }
  }, { rootMargin: '800px' });
  showPages.painter = painter;
  root.replaceChildren(...spreads.map((pair) => {
    const spread = document.createElement('div');
    spread.className = 'pt-spread';
    for (const p of pair) {
      const figure = document.createElement('figure');
      if (p) {
        const label = p.page.pageLabel || String(p.n + 1);
        const canvas = document.createElement('canvas');
        canvas.postext = p;
        canvas.style.aspectRatio = `${p.page.width} / ${p.page.height}`;
        canvas.setAttribute('role', 'img');
        canvas.setAttribute('aria-label', `Page ${label}`);
        const folio = document.createElement('figcaption');
        folio.textContent = label;
        figure.append(canvas, folio);
        painter.observe(canvas);
      } else figure.className = 'pt-blank';
      spread.append(figure);
    }
    return spread;
  }));
  kitStatus(`${pages.length} ${pages.length === 1 ? 'page' : 'pages'}`);
  document.documentElement.dataset.postext = 'ready';
  return pages.length;
}

/** The desk, the bar and the error reporting, created once. */
function viewer(title) {
  if (!document.getElementById('pt-kit')) {
    document.head.insertAdjacentHTML('beforeend', `<style id="pt-kit">
      :root { color-scheme: dark; }
      body { margin: 0; background: #0e1014; color: #b9bcc4; font: 13px/1.45 system-ui, sans-serif; }
      #pt-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
        gap: 6px 16px; padding: 10px 16px; background: rgb(14 16 20 / .92); backdrop-filter: blur(6px);
        border-bottom: 1px solid #23262d; }
      #pt-bar strong { color: #f4f1ea; font-weight: 600; }
      #pt-actions { display: flex; gap: 12px; margin-left: auto; }
      #pt-actions a, #pt-actions button { color: #d8a21a; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
      #pages { display: grid; justify-items: center; gap: 48px; padding: 32px 16px 72px; }
      .pt-spread { display: flex; }
      .pt-spread figure { margin: 0; width: min(460px, 44vw); }
      .pt-spread canvas { display: block; width: 100%; background: #fff;
        box-shadow: 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figure:first-child canvas { box-shadow: inset -14px 0 14px -14px rgb(0 0 0 / .18), 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figcaption { margin-top: 10px; text-align: center; font: 600 10px/1 system-ui, sans-serif;
        letter-spacing: .18em; text-transform: uppercase; color: #6c7079; }
      .pt-blank { visibility: hidden; }
      @media (max-width: 760px) {
        .pt-spread { flex-direction: column; gap: 32px; }
        .pt-spread figure { width: min(460px, 92vw); }
        .pt-blank { display: none; }
      }
    </style>`);
    document.body.insertAdjacentHTML('afterbegin',
      '<header id="pt-bar"><strong id="pt-title"></strong><span id="pt-status" role="status"></span><span id="pt-actions"></span></header>');
    document.getElementById('pt-title').textContent = document.title || 'Postext';
    addEventListener('error', (event) => kitFail(event.error ?? event.message));
    addEventListener('unhandledrejection', (event) => kitFail(event.reason));
  }
  if (title) document.getElementById('pt-title').textContent = title;
  return document.getElementById('pages')
    ?? document.body.appendChild(Object.assign(document.createElement('main'), { id: 'pages' }));
}

function kitStatus(text) {
  viewer();
  document.getElementById('pt-status').textContent = text;
}

function kitFail(error) {
  document.documentElement.dataset.postext = 'error';
  kitStatus(`Error: ${error?.message ?? error}`);
}

// ─── /Kit ───────────────────────────────────────────────────────────────────────
```

## 常见问题

- **标题样式会继承其级别的分页设置.** headingStyles中的条目没有写出的字段都取自它所属的标题级别，breakBefore也不例外。在:::pagebreak之后以H1设置样式的目录页或版权页会继承parity 'odd'，结果落在一张空白页之后。给这类样式设置breakBefore: { enabled: false }。

- 没有greek-ext文件，每个带重音的元音都会落到很少匹配的系统字体上。捕获会对照已加载的文件检查每个字形（C36），并判这样的页面不合格。
- GFS Didot只有一个字重，没有斜体：强调会被渲染器硬斜。所以文本说明用正体。
- 工具包的PDF字体提供器只加载latin和greek，所以本例只显示画布，不提供PDF。
- 译文的每一行都不能超出行宽。转行的一行会把该页其余部分往下推一行，两页就不再逐行对应；10.2 pt下的103 mm能容纳Eftaliotis最长的一行，59个字母。

## 致谢

- 食谱: Ignacio Ferro ([@drnachio](https://github.com/drnachio))
- 文字: Odyssey, Book I, lines 1–27, in the polytonic text of el.wikisource (revision 165777): Homer ([来源](https://el.wikisource.org/wiki/Οδύσσεια/α)), 公有领域
- 文字: The modern Greek translation of the same lines, line for line, from el.wikisource (revision 166701), with one accent corrected: Argyris Eftaliotis ([来源](https://el.wikisource.org/wiki/Οδύσσεια_(Μετάφραση_Εφταλιώτη)/α)), 公有领域
- 文字: Life of Homer, §§ 6–7 and the epitaph, from the Suda (ed. A. Westermann, 1845), via el.wikisource (revision 152483), with four slips corrected: Hesychius of Miletus ([来源](https://el.wikisource.org/wiki/Ησυχίου_Βίος_Ομήρου)), 公有领域
- 文字: The note on the text and the colophon: Postext Cookbook, 原创
- 字体: GFS Didot (OFL-1.1)
- 代码: MIT · 示例内容: CC-BY-4.0

## 相关食谱

- [No. 083 · 唐诗与英译对页排](https://postext.dev/zh/cookbook/tang-poems-facing-english.md): 每首唐诗占一个浅色底纹的右页，Giles的英译占对面的左页：一种标题样式分页到偶数页，另一种分页到奇数页。 · 难度 2 (中级) · 诗歌
- [No. 044 · 校勘本：行号与按行号编排的注释](https://postext.dev/zh/cookbook/critical-edition-line-numbers.md): 按1645年文本排弥尔顿的《Lycidas》：lineNumbers给诗行计数，把每第五行的行号印在侧栏里，每条注释以其行号开头，行号排成行内标签。 · 难度 3 (高级) · 诗歌
- [No. 043 · 逐节对照的双语译诗](https://postext.dev/zh/cookbook/bilingual-facing-verse.md): 每首诗是一个无边框的双栏框：固定的分栏点让英文从标题开始，:::space让每一节与原文齐平。 · 难度 2 (中级) · 诗歌
