Kurz gesagt
Ein kleiner Gedichtband mit dem spanischen Text auf der einen Seite und der englischen Übersetzung daneben. Jede Gruppe von Versen in der Übersetzung beginnt auf gleicher Höhe wie das Original.
Was Sie setzen
Ein zweisprachiger Gedichtband mit fünf Gedichten über eine Saline im Süden Spaniens, 156 × 234 mm, links das Spanische, rechts die englische Fassung des Dichters selbst, Zeile für Zeile. Zuerst kommen eine Titelseite mit einem Flamingo und die Vorbemerkung des Autors; die Gedichte beginnen unter einem Aquarell mit rosa Becken, Salzhaufen und Flamingos bei Sonnenaufgang. Jedes Gedicht steht in einem rahmenlosen Kasten unter einer krapproten Ziffer in der Castoro Titling, das Spanische in der einen Spalte, das Englische in der anderen. Das Englische beginnt auf derselben Zeile wie das Spanische, und jede Strophe beginnt auf gleicher Höhe wie ihr Original. Ist eine englische Zeile zu lang für ihre Spalte, läuft ihr Rest um 2 em eingerückt in die nächste Zeile, und die spanische Strophe gegenüber endet mit einer zusätzlichen Leerzeile.
Dieses Rezept beantwortet
- Wie setze ich zwei Spalten in einen Kasten (eine Textspalte neben einer Abbildungsspalte)?
- Wie setze ich Lyrik: eine Zeile pro Vers, Abstand zwischen Strophen, hängende Einzüge für umbrochene Zeilen, keine Silbentrennung?
- Wie füge ich zusätzlichen vertikalen Abstand zwischen zwei Blöcken ein, wenn Leerzeilen nichts bewirken?
- Wie erreiche ich guten Blocksatz und gute Silbentrennung für spanischen, französischen oder deutschen Text?
Die kurze Antwort
// Each poem is a box titled with its numeral, holding one two-column group. breaks="5"
// opens the second column at the group's 5th block, since the Spanish title and its three
// stanzas come before it. A :::space is not a block, so the gaps leave the count alone:
// :::callout{type="poem" title="I"}
// :::columns{count=2 breaks="5"}
// Spanish title, :::space{lines=0.5}, its stanzas in :::verse blocks
// English title, :::space{lines=0.5}, its stanzas in :::verse blocks
// :::
// :::
// Both columns open on the same line, so matching :::space gaps keep the stanzas level.
// keepTogether: false lets a poem that does not fit go on overleaf. A group with breaks is
// cut stream by stream (flow="parallel"): each language goes on in its own column, level.
const poem = {
id: 'poem',
backgroundEnabled: false, // no fill, border or stripe
padding: { top: pt(0), right: pt(0), bottom: pt(0), left: pt(0) },
columnGap: mm(GAP),
titleStyle: { fontFamily: 'Castoro Titling', fontSize: pt(22), fontWeight: 400,
color: col('madder'), gap: pt(4) },
// A box starts on the first grid line at least two lines down, under the picture as under
// a poem (12.3 mm there: its box ends off the grid). The default marginBottom (0.75 em)
// would add to marginTop and open 17.4 mm between poems.
marginTop: pt(LEAD * 2), marginBottom: pt(0),
keepTogether: false, // a long poem goes on overleaf instead of moving whole
};
Zutaten
- Funktionen
- Verse Zeile für ZeileSpalten in einem Kasten oder im TextExpliziter vertikaler AbstandAbsatzformateKästenSilbentrennung und DokumentspracheÜberschriftenformateGestaltete AuftakteÜberschriftenattributeBilder in SeitengestaltungenUmschläge, Titelseiten und ImpressumDokument-MetadatenSpaltenausgleichKolumnentitel und SeitenzahlenKopfzeilen nach SeitenrolleGespiegelte RänderSemantische FarbpaletteAbbildungen und Tabellen als RessourcenKolumnentitel je AbschnittSeiten auf einem Canvas
- Schrift
- Castoro, Castoro Titling, Tenor Sans (SIL OFL 1.1)
- Dateien
flamingo-680.jpgsalina-1560.jpg- The salt pans at sunrise over the poems, a watercolour (Generated With Diffusion Models, eigener Text)
- The flamingo on the title page, a watercolour (Generated With Diffusion Models, eigener Text)
Zubereitung
#1 · Ein Gedicht ist ein Kasten mit festem Spaltenumbruch
Der Code steht oben in der kurzen Antwort. Jedes Gedicht ist ein Kasten um eine Gruppe :::columns; sein Stil verzichtet auf Fläche und Innenabstand und gibt den title des Containers aus, die Ziffer (:::columns). Ohne breaks bricht die Gruppe dort um, wo ihre beiden Spalten gleich hoch ausgehen. Beide Hälften dieser Gedichte sind gleich hoch, also fällt der Umbruch ohnehin auf den englischen Titel; verlängern Sie zwei Zeilen von The Rake, bis sie umbrechen, und der Umbruch rückt einen Block nach unten und lässt THE RAKE am Fuß der spanischen Spalte stehen. breaks="5" gibt den Block an, mit dem die zweite Spalte beginnt, sodass der englische Titel sie anführt, wie hoch die beiden Hälften auch sind.
#2 · Ein Block :::verse pro Spalte, eine Leerzeile pro Strophenwechsel
// Each half of a poem is a :::verse block, a line of verse a line of Markdown and a blank line
// between stanzas. A line too long for its 55 mm column turns over 2 em in, where it cannot
// pass for the next line; the Spanish half then ends that stanza's block and a
// :::space{lines=2} before the next keeps the stanzas level across the gutter.
const verse = { id: 'verse', hangingIndent: em(2) };
// Castoro Titling draws capitals only. A :::space{lines=0.5} in the Markdown sets each title
// off its poem.
const poemTitle = { id: 'poem-title', fontFamily: 'Castoro Titling', fontSize: pt(9.5),
color: col('madder'), firstLineIndent: pt(0) };
Jede Hälfte eines Gedichts ist ein Block :::verse: ein Vers pro Markdown-Zeile, im Flattersatz und nie getrennt, und zwischen den Strophen eine Leerzeile, die in der Spalte eine Leerzeile lässt (:::verse). Jede Strophe ist ein Block, also zählt breaks Strophen, nicht Zeilen. Das englische each one standing on its own reflection. ist zu lang für seine 55 mm breite Spalte und bricht um 2 em eingerückt um; die spanische Hälfte schließt ihren Block nach der gegenüberliegenden Strophe und setzt vor die nächste ein :::space{lines=2}, sodass die folgenden Strophen auf derselben Zeile beginnen. Ein :::space ist kein Block, und breaks zählt es nicht mit (:::space).

#3 · Die Vorbemerkung wird in ihrer eigenen Sprache getrennt
const LOCALE = t({ en: 'en-us', es: 'es' }); // the patterns of the edition's language
const bodyText = {
fontFamily: 'Castoro', fontSize: pt(10.5), lineHeight: pt(LEAD), color: col('ink'),
italicColor: col('ink'), firstLineIndent: mm(4.5), indentAfterHeading: false,
minWordSpacing: 0.8, maxWordSpacing: 1.35, // word spaces from 0.8 to 1.35 of normal
// No bold on these pages: ink keeps a **bold** or a :ref added later off the default blue
// (#295AA3). References take boldColor while referenceColor is unset.
boldColor: col('ink'),
};
// The heading prints its title 36 mm down the text block, and the note starts under it.
const notePage = { id: 'note', advancedDesign: { enabled: true, slot: {
elements: [{ kind: 'text', id: 'title', content: '{titleText}', align: 'left',
fontFamily: 'Castoro Titling', fontSize: pt(13), color: col('madder'), overflow: 'wrap',
placement: { anchor: { to: 'container', edge: 'top-left' }, offset: { y: mm(36) } } }],
} } };
locale wählt die Trennmuster. Mit 'es' trennt die spanische Vorbemerkung ori-ginal und Duna-liella; mit den englischen Mustern gehen beide Wörter ganz in die nächste Zeile, und nur arras-traba wird in beiden Fällen getrennt (unterstützte Locales). Wortabstände dürfen auf das 0,8-Fache ihrer normalen Breite schrumpfen und sich auf das 1,35-Fache dehnen, und keine Blocksatzzeile in einer der beiden Vorbemerkungen dehnt sich darüber hinaus. Die Überschrift der Vorbemerkung ist eine Gestaltung, deren einziges Element, der Titel, 36 mm unter der Oberkante des Satzspiegels steht, sodass die Vorbemerkung 73 mm unter der Oberkante ihrer Seite beginnt.
#4 · Titelseite und Aquarell sind Überschriften
const onPage = (y) => ({ anchor: { to: 'page', edge: 'top' }, offset: { y: mm(y) } });
const face = (id, content, font, size, y, extra = {}) => ({ kind: 'text', id, content,
fontFamily: font, fontSize: pt(size), color: col('ink'), align: 'center', overflow: 'wrap',
placement: onPage(y), ...extra });
const tracked = { letterSpacing: pt(2), textTransform: 'uppercase' };
const image = (id, placement) => ({ kind: 'image', id, resourceId: id, placement });
const titlePage = {
id: 'title-page',
header: { elements: [] }, footer: { elements: [] }, // no running head, no folio
advancedDesign: { enabled: true, slot: { elements: [
face('author', '{author}', 'Tenor Sans', 9, 44, { ...tracked, color: col('muted') }),
face('title', '{titleText}', 'Castoro Titling', 34, 58, { lineHeight: 1 }),
face('other', '{attr.other}', 'Castoro', 16, 76, { italic: true, color: col('madder') }),
image('flamingo', { ...onPage(96), size: { width: mm(34) } }),
face('edition', '{attr.edition}', 'Tenor Sans', 8.5, 170, tracked),
face('version', '{attr.version}', 'Castoro', 10.5, 176, { italic: true }),
face('press', '{attr.press}', 'Tenor Sans', 8, 206, { ...tracked, color: col('muted') }),
] } },
};
// The picture of the salt pans runs 84 mm down from the top edge of the page, and the heading
// reserves down to its foot. No margin under it: the poem's own marginTop sets the gap.
const poemsOpener = {
id: 'poems', marginBottom: pt(0),
advancedDesign: { enabled: true, slot: { elements: [
image('salina', { anchor: { to: 'page', edge: 'top-left' }, size: { width: 'fill' } }),
face('title', '{titleText}', 'Castoro Titling', 38, 17, { lineHeight: 1 }),
face('other', '{attr.other}', 'Castoro', 15, 33, { italic: true, color: col('madder') }),
] } },
};
Beide sind Überschriften der Ebene 1 mit eigenem Stil (Überschriftenstile): Die Gestaltung der Titelseite nimmt {author} aus dem Frontmatter, und beide Gestaltungen nehmen {attr.other} aus den Attributen der Überschrift. Das Aquarell ist an der Oberkante der Seite verankert, über dem Satzspiegel, und die Überschrift reserviert Platz bis zu seinem Fuß, 84 mm weit hinunter. Der Stil setzt marginBottom: pt(0), sodass der Abstand unter dem Bild der eigene obere Rand des Gedichts von zwei Zeilen ist und Gedicht I auf der ersten Rasterlinie mindestens zwei Zeilen unter dem Bild beginnt.
#5 · Die Kolumnentitel nennen beide Sprachen
const edgeAt = (edge, x, y) => ({ anchor: { to: 'page', edge }, offset: { x: mm(x), y: mm(y) } });
const head = (id, content, parity, placement, extra = {}) => ({ kind: 'text', id, content,
parity, pages: 'body', fontFamily: 'Tenor Sans', fontSize: pt(7.5), color: col('muted'),
...tracked, letterSpacing: pt(1.5), placement, ...extra });
const folio = { color: col('ink'), letterSpacing: pt(0) };
const TITLES = ['Sal de agosto', 'August Salt']; // the book's title in its two languages
const header = { elements: [
head('verso-folio', '{pageNumber}', 'even', edgeAt('top-left', OUTER, 12), folio),
head('verso-title', TITLES[0], 'even', edgeAt('top-left', OUTER + 8, 12)),
head('recto-title', TITLES[1], 'odd', edgeAt('top-right', -(OUTER + 8), 12)),
head('recto-folio', '{pageNumber}', 'odd', edgeAt('top-right', -OUTER, 12), folio),
] };
// The note and the picture open their pages ('opener'): a folio at the foot instead.
const footer = { elements: [head('drop-folio', '{pageNumber}', 'all', edgeAt('bottom', 0, -12),
{ ...folio, pages: 'opener' })] };
Auf der linken Seite steht der spanische Titel, auf der rechten der englische, in der Reihenfolge der Spalten. pages: 'body' hält sie von den drei Seiten fern, die mit einer Überschrift beginnen. Vorbemerkung und Aquarell bekommen stattdessen eine Seitenzahl am Fuß, und der Stil der Titelseite leert Kopf- und Fußzeile (Textelemente).
Das ganze Rezept
// ═══ Postext Cookbook · Nº 043 · Facing translation, stanza by stanza ═══════════════════
// https://postext.dev/en/cookbook/bilingual-facing-verse
// Code: MIT · Text: original (CC BY 4.0) · Salt pans and flamingo: diffusion models
// Fonts: Castoro, Castoro Titling, Tenor Sans (SIL OFL 1.1) · Needs postext ≥ 1.34.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'bilingual-facing-verse';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
const palette = { // every colour in the config links to one of these
ink: '#1f2430', // the text: a blue-black
madder: '#9a3c52', // the one accent: numerals, poem titles, the other language's title
muted: '#6a6770', // running heads, folios, the author's name, the colophon
paper: '#ffffff',
};
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' } }));
const TRIM_W = 156, TRIM_H = 234; // mm
const TOP = 22, OUTER = 18, INNER = 20; // mm: the text block is 118 mm wide
const LEAD = 14.5; // pt: the leading of the note and of every line of verse
const GAP = 8; // mm between the original and the translation: each column is 55 mm wide
// #region answer: a poem and its translation: a box with two columns and a fixed break
// Each poem is a box titled with its numeral, holding one two-column group. breaks="5"
// opens the second column at the group's 5th block, since the Spanish title and its three
// stanzas come before it. A :::space is not a block, so the gaps leave the count alone:
// :::callout{type="poem" title="I"}
// :::columns{count=2 breaks="5"}
// Spanish title, :::space{lines=0.5}, its stanzas in :::verse blocks
// English title, :::space{lines=0.5}, its stanzas in :::verse blocks
// :::
// :::
// Both columns open on the same line, so matching :::space gaps keep the stanzas level.
// keepTogether: false lets a poem that does not fit go on overleaf. A group with breaks is
// cut stream by stream (flow="parallel"): each language goes on in its own column, level.
const poem = {
id: 'poem',
backgroundEnabled: false, // no fill, border or stripe
padding: { top: pt(0), right: pt(0), bottom: pt(0), left: pt(0) },
columnGap: mm(GAP),
titleStyle: { fontFamily: 'Castoro Titling', fontSize: pt(22), fontWeight: 400,
color: col('madder'), gap: pt(4) },
// A box starts on the first grid line at least two lines down, under the picture as under
// a poem (12.3 mm there: its box ends off the grid). The default marginBottom (0.75 em)
Das zusammengesetzte script.js läuft unverändert: Fügen Sie es in das Modulskript einer beliebigen Seite ein, oder öffnen Sie das Rezept auf CodePen. Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)
Varianten
#Den Spaltenabstand vergrößern
Bei 12 mm schrumpfen die Spalten auf 53 mm, und Los turistas paran y hacen fotos: bricht in Gedicht III um, sodass seine zweite Strophe eine Zeile unter der englischen beginnt; schließen Sie den englischen Block nach dieser Strophe und setzen Sie vor die nächste ein :::space{lines=2}, um beide anzugleichen.
-const GAP = 8; // mm between the original and the translation: each column is 55 mm wide
+const GAP = 12; // mm between the original and the translation: each column is 53 mm wide#Umbruchzeilen tiefer einziehen
Bei 3 em beginnt reflection. auf Seite 3 ein Geviert weiter innen.
-const verse = { id: 'verse', hangingIndent: em(2) };
+const verse = { id: 'verse', hangingIndent: em(3) };Häufige Fehler
- Ein
:::spacevor dem englischen Titel verschwindet: Die zweite Spalte beginnt bei dem Block, denbreaksangibt, und der Abstand fällt genau auf den Umbruch. Setzen Sie ihn nach den Titel, wie das:::space{lines=0.5}unter jedem Spaltentitel hier. - Zählen Sie
breaksab dem spanischen Titel: Bei einem Titel und drei Strophen ist der englische Titel Block 5. Jede Strophe ist ein Block, also schiebt eine spanische Strophe mehr den englischen Titel auf Block 6, undbreaksmuss mitwachsen; eine Zeile mehr innerhalb einer Strophe verschiebt nichts.
Nachweise
- Rezept
- Ignacio Ferro
- Text
- The poem cycle Sal de agosto and its English version, August Salt, with the author’s note, written for this recipe; the poet Adela Membrives is fictional · Postext Cookbook · CC BY 4.0
- Bilder
- The salt pans at sunrise over the poems, a watercolour · Generated With Diffusion Models · eigener Text
- The flamingo on the title page, a watercolour · Generated With Diffusion Models · eigener Text
- Schriften
- Castoro (SIL OFL 1.1) · Castoro Titling (SIL OFL 1.1) · Tenor Sans (SIL OFL 1.1)
- Code
- MIT, wie Postext
Diesen Text bearbeiten ↗ (öffnet sich in einem neuen Tab)Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)


