Zum Hauptinhalt springen
Rezept Nummer 114

Rezepte · Kapitel 1 · Seite und Raster

Eine Bulaq-Seite: der Text im Rahmen seines Kommentars

Ibn ʿAqīls Grammatikkommentar in der Hauptspalte, Glossen in der äußeren Seitenspalte neben den erklärten Stellen, alles in einem doppelten Linienrahmen.

Auf dieser Seite
Ausgabe
Canvas · PDF
Stufe
Mittel
Postext
Getestet mit Postext 1.65.0
Erfordert ≥ 1.28.0 · postext-pdf ≥ 1.28.0
Lizenz
Aktualisiert am 11. Okt. 2026
Code MIT · Text MIT

S. ٢–٣ · 2–3 von 6

  • Englisches Beispiel: noch keine deutsche Ausgabe
  • Endformat 170 × 240 mm
  • Anderthalb Spalten, Spaltenabstand 7 mm
  • Amiri 12,5/22
  • Aref Ruqaa
  • 6 Seiten
  • Stufe
  • Postext 1.65.0
  • In 138 ms gesetzt
  • 139 Zeilen Code

Kurz gesagt

Eine Seite wie in den arabischen Büchern, die im 19. Jahrhundert in Kairo gedruckt wurden: der Haupttext in der Mitte, kurze Anmerkungen dazu in einer schmalen Spalte am Rand und die ganze Seite von gedruckten Linien eingerahmt.

Was Sie setzen

Sechs Seiten, gesetzt wie die Druckerei von Bulaq und ihre Kairoer Nachfolger im 19. Jahrhundert einen Kommentar druckten. Ibn ʿAqīls Erklärung der ersten Verse der Alfiyya, der Grammatik Ibn Māliks in tausend Versen, läuft in der Hauptspalte, die Verse in Rot; am Außenrand steht eine Ḥāschiya, kurze Glossen, die jeweils mit den Wörtern des erklärten Textes beginnen, neben der Stelle, zu der sie gehören. Eine Doppellinie rahmt den Satzspiegel, mit einem Band an seinem Kopf für Kapitel und Pagina, und eine einfache Linie trennt den Text von seinem Rand. Eine echte Bulaq-Seite legt die Ḥāschiya um drei Seiten des Textes; Postext setzt sie nur auf eine Seite, und dieses Rezept sagt es.

Dieses Rezept beantwortet

  • Wie gestalte ich eine Bulaq-Seite, bei der der Kommentar den Text umrahmt?

Die kurze Antwort

script.js · Zeilen 31–45im vollständigen Code
// The text runs in the main column of a column-and-a-half layout; the side column, on the
// outer side, takes only boxes with span 'side'. A gloss is written before the passage it
// explains and starts level with its first line, on the page where that passage goes on
// (sideAtColumnEnd: 'after'). A column rule parts the two, as the jadwal of a Bulaq page does.
const layout = { layoutType: 'oneAndHalf', sideColumnRole: 'floats', sideColumnSide: 'outer',
  sideColumnPercent: 31, gutterWidth: mm(7),
  columnRule: { enabled: true, color: col('rule'), lineWidth: pt(0.6) } };
// A gloss is a callout with no box: the margin's own face, its lemma bold in the rubric.
const hashiya = { id: 'hashiya', span: 'side', sideAtColumnEnd: 'after',
  backgroundEnabled: false, borderRadius: pt(0),
  padding: { top: pt(0), right: pt(0), bottom: pt(0), left: pt(0) },
  stripe: { enabled: false }, border: { enabled: false },
  body: { fontFamily: NASKH, fontSize: pt(10), lineHeight: pt(16), color: col('ink'),
    boldColor: col('rubric'), textAlign: 'justify', firstLineIndent: pt(0),
    paragraphSpacing: true } };

Zutaten

Schrift
Amiri, Aref Ruqaa (SIL OFL 1.1)
Dateien
Keine: Jedes Bild wird im Code gezeichnet

Zubereitung

#1 · Die Ḥāschiya in einer eigenen Seitenspalte

Der Code steht oben in der kurzen Antwort. Ein Layout mit anderthalb Spalten, dessen Seitenspalte nur Gleitobjekte aufnimmt, hält den Kommentar aus dem Textfluss heraus: Jede Glosse ist ein :::callout{type="hashiya" span="side"}, geschrieben vor der Stelle, die sie erklärt, und sie beginnt auf der Höhe der ersten Zeile dieser Stelle; sideAtColumnEnd: 'after' hält sie neben der Stelle, wenn diese auf der nächsten Seite weiterläuft (Layout). Der Kasten hat weder Hintergrund noch Kontur noch Innenabstand, er liest sich also wie Text am Rand, sein Lemma fett, das boldColor rot färbt. sideColumnSide: 'outer' legt die Spalte auf beiden Seiten an den Außenrand: rechts auf der geraden Seite, die in einem rechts gebundenen Buch rechts liegt.

Seite 2: Die Glosse zu «كديز» beginnt auf der Höhe des Absatzes, der das Wort verwendet, am Außenrand hinter der Spaltenlinie.

#2 · Ein Rahmen für jede Seite der Doppelseite

script.js · Zeilen 49–79im vollständigen Code
// Page-level design elements are physical: the frame follows the margins of each side of
// the spread. In a book bound on the right the even page is the right-hand one, its spine
// on its left, so its inner margin is the left one. A heading's design is set in the flow
// and mirrored with the page (inFlow): there 'left' is the sheet's right.
const frame = (parity, withBand = true, inFlow = false) => {
  const left = (parity === 'even') !== inFlow ? M.inner : M.outer;
  const width = TRIM.width - M.inner - M.outer;
  const box = (id, inset, thickness) => ({ kind: 'box', id: `${id}-${parity}`, parity,
    style: { borderColor: col('rule'), borderWidth: pt(thickness) },
    placement: { anchor: { to: 'page', edge: 'top-left' },
      offset: { x: mm(left - 4 + inset), y: mm(M.top - 13 + inset) },
      size: { width: mm(width + 8 - 2 * inset),
        height: mm(TRIM.height - M.top - M.bottom + 17 - 2 * inset) } } });
  return [box('outer', 0, 1.4), box('inner', 1.3, 0.4), ...(withBand ? [
    { kind: 'rule', id: `band-${parity}`, parity, direction: 'horizontal', thickness: pt(0.4),
      color: col('rule'), placement: { anchor: { to: 'page', edge: 'top-left' },
        offset: { x: mm(left - 2.7), y: mm(M.top - 4) },
        size: { width: mm(width + 5.4) } } }] : [])];
};
// The chapter centred in the band, the folio at its outer end. The frame stands off the
// sheet's centre by half the difference of the margins, towards the outer edge.
const SHIFT = (M.inner - M.outer) / 2; // mm
const band = (id, content, parity, edge, x, extra = {}) => ({ kind: 'text', id, content,
  parity, pages: 'body', fontFamily: NASKH, fontWeight: 700, fontSize: pt(10.5),
  color: col('ink'),
  placement: { anchor: { to: 'page', edge }, offset: { x: mm(x), y: mm(M.top - 11) } }, ...extra });
const header = { elements: [...frame('even'), ...frame('odd'),
  band('head-even', '{chapterTitle}', 'even', 'top', SHIFT),
  band('head-odd', '{chapterTitle}', 'odd', 'top', -SHIFT),
  band('folio-even', '{pageNumber}', 'even', 'top-right', -(M.outer + 1), { pages: 'all' }),
  band('folio-odd', '{pageNumber}', 'odd', 'top-left', M.outer + 1, { pages: 'all' })] };

Der Rahmen besteht aus drei Gestaltungselementen der Seite in der Kopfzeile: zwei Rechtecke mit Kontur und ohne Füllung im Abstand von 1,3 mm und einer Linie unter dem Band mit dem Kolumnentitel. Seitenelemente sind physisch, deshalb wird der Rahmen zweimal gebaut, einmal je Parität, aus den Rändern dieser Seite (Seitenreihenfolge und Bindung rechts). Die Pagina steht auf jeder Seite am äußeren Ende des Bandes, auch auf Auftaktseiten; der Kapiteltitel ist zentriert und fehlt auf der Auftaktseite, wo der Titel selbst darunter steht.

#3 · Eine Titelseite im selben Rahmen

script.js · Zeilen 83–101im vollständigen Code
const line = (id, content, y, style) => ({ kind: 'text', id, content, align: 'center',
  overflow: 'wrap', color: col('ink'),
  // Centred in the frame: the title page is an odd page set in the mirrored flow.
  placement: { anchor: { to: 'page', edge: 'top' }, offset: { x: mm(SHIFT), y: mm(y) },
    size: { width: mm(110) } }, ...style });
const titlePage = { id: 'title', span: 'page', runningChapter: false,
  breakBefore: { enabled: true, parity: 'any' }, header: { elements: [] },
  footer: { elements: [] },
  advancedDesign: { enabled: true, slot: { elements: [...frame('odd', false, true),
    line('book', '{titleText}', 64, { fontFamily: RUQAA, fontWeight: 700, fontSize: pt(40),
      lineHeight: 1.3, color: col('rubric') }),
    line('on', '{attr.on}', 88, { fontFamily: NASKH, fontWeight: 700, fontSize: pt(17) }),
    { kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(0.75), color: col('rubric'),
      placement: { anchor: { to: 'page', edge: 'top' }, offset: { x: mm(SHIFT), y: mm(104) },
        size: { width: mm(30) } } },
    line('margin', '{attr.margin}', 112, { fontFamily: NASKH, fontSize: pt(13) }),
    line('latin', '{attr.latin}', 196, { fontFamily: NASKH, fontSize: pt(9), italic: true,
      color: col('muted') }),
  ] } } };

Die Titelseite verwendet den Rahmen ohne sein Band wieder. Die Gestaltung einer Überschrift steht im Fluss und wird mit der Seite gespiegelt, deshalb wird der Rahmen dort mit vertauschten Seiten gebaut (inFlow): Seine linke Seite ist die rechte des Blattes. Seine Zeilen kommen aus Attributen der Überschrift, on und margin, sodass die ganze Titelseite eine einzige Zeile Markdown ist, und die lateinische Zeile darunter wechselt mit der Ausgabe.

Das ganze Rezept

Sandbox
// ═══ Postext Cookbook · Nº 114 · A Bulaq page: the text framed by its commentary ════════
// https://postext.dev/en/cookbook/bulaq-framed-page
// Code: MIT · Text: Ibn ʿAqīl, Sharḥ; Ibn Mālik, Alfiyya, ar.wikisource (PD) · Pictures: none
// Fonts: Amiri, Aref Ruqaa (SIL OFL 1.1) · Needs postext ≥ 1.28.0
import { buildDocument, withLoadedFonts, renderPageToCanvas } from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'bulaq-framed-page';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black and a brown-red on a toned paper: the two inks of a Cairo press around 1900.
const palette = {
  ink: '#1d1915', // text and frame rules
  rubric: '#8e3020', // the accent: lemmas of the glosses, the matn, titles
  rule: '#3a312a', // the frame
  muted: '#6a6056', // the note on the text
  paper: '#f6efe0', // a toned 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: 'rubric (defaults)', value: { hex: palette.rubric, model: 'hex' } },
];
const NASKH = 'Amiri'; // the text, the matn and the glosses
const RUQAA = 'Aref Ruqaa'; // the title page and the chapter title
const TRIM = { width: 170, height: 240 }; // mm
const M = { top: 34, bottom: 24, inner: 20, outer: 15 }; // mm: the type area inside the frame

// #region answer: the commentary's column beside the text, both inside one ruled frame
// The text runs in the main column of a column-and-a-half layout; the side column, on the
// outer side, takes only boxes with span 'side'. A gloss is written before the passage it
// explains and starts level with its first line, on the page where that passage goes on
// (sideAtColumnEnd: 'after'). A column rule parts the two, as the jadwal of a Bulaq page does.
const layout = { layoutType: 'oneAndHalf', sideColumnRole: 'floats', sideColumnSide: 'outer',
  sideColumnPercent: 31, gutterWidth: mm(7),
  columnRule: { enabled: true, color: col('rule'), lineWidth: pt(0.6) } };
// A gloss is a callout with no box: the margin's own face, its lemma bold in the rubric.
const hashiya = { id: 'hashiya', span: 'side', sideAtColumnEnd: 'after',
  backgroundEnabled: false, borderRadius: pt(0),
  padding: { top: pt(0), right: pt(0), bottom: pt(0), left: pt(0) },
  stripe: { enabled: false }, border: { enabled: false },
  body: { fontFamily: NASKH, fontSize: pt(10), lineHeight: pt(16), color: col('ink'),
    boldColor: col('rubric'), textAlign: 'justify', firstLineIndent: pt(0),
    paragraphSpacing: true } };
// #endregion

// #region frame: a double rule round the type area and a band for the running head

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 Kommentar an den Bundsteg legen

Manche Druckereien setzen die Ḥāschiya an den Bund, damit der Text den breiteren Außenrand behält.

-const layout = { layoutType: 'oneAndHalf', sideColumnRole: 'floats', sideColumnSide: 'outer',
+const layout = { layoutType: 'oneAndHalf', sideColumnRole: 'floats', sideColumnSide: 'inner',

#Jede Glosse einrahmen

Eine dünne Linie um jede Glosse, wie sie manche späteren Kairoer Drucke zeigen, ist die eigene Kontur des Kastens.

-  stripe: { enabled: false }, border: { enabled: false },
+  stripe: { enabled: false }, border: { enabled: true, width: pt(0.4), color: col('rule') },

Häufige Fehler

Häufiger Fehler

Zeichnen Sie ein arabisches Buch mit 'ar' aus, nicht mit LANG

Die Ausgaben eines Rezepts sind en und es, ein arabisches Beispiel ist aber in beiden Arabisch: `locale: LANG` würde es von links nach rechts setzen, links binden, seine Seiten 1 2 3 nummerieren und seine Abbildungen mit Figure oder Figura beschriften. Seit postext 1.30 ist die Auszeichnung auch die Sprache, in der der Text geformt wird (gemessen, gezeichnet und eingebettet). Unter einer englischen oder spanischen Auszeichnung zeichnet eine Schrift wie Markazi Text daher die arabischen Formen ihrer Guillemets und Satzzeichen nicht, und die Zeilen brechen an anderer Stelle um. Schreiben Sie die Auszeichnung selbst: 'ar' (arabisch-indische Ziffern, die Maschrek-Konvention), eine Region wie 'ar-EG' oder 'ar-SA', oder 'ar-MA', 'ar-DZ' bzw. 'ar-TN' für eine Maghreb-Ausgabe mit europäischen Ziffern. Eine lateinische Seite, die Arabisch nur zitiert, behält ihr eigenes Gebietsschema. Text von rechts nach links →

Häufiger Fehler

Arabische Schnitte brauchen ihre arabic-Datei, über den Block arabic

Fontsource liefert Amiri, Noto Naskh Arabic oder Scheherazade New als eine Datei pro Teilmenge aus, und die arabischen Buchstaben stehen in der Datei arabic. loadFonts holt nur latin (und latin-ext), am Bildschirm stammt das Arabische also aus einer Systemschrift und wird falsch gemessen, und fontsourceProvider gibt dem PDF diese latin-Datei, die leere Kästchen druckt. Führen Sie den Kit-Block arabic auf, rufen Sie loadArabicFonts(FONTS, markdown) nach loadFonts auf, mit jeder Schriftstärke, die die Seiten auf Arabisch setzen, in FONTS aufgeführt, und geben Sie renderToPdf fontProvider: arabicPdfProvider. Arabische Schriften →

Nachweise

Text
  • Ibn ʿAqīl’s commentary on the opening of the Alfiyya, with Ibn Mālik’s verses, as ar.wikisource gives it (revision 521625), without the modern editor’s footnotes · Ibn ʿAqīl, Ibn Mālik · gemeinfrei
  • The glosses in the margin, the title page, the note on the text and the colophon · Postext Cookbook · eigener Text
Schriften
Amiri (SIL OFL 1.1) · Aref Ruqaa (SIL OFL 1.1)
SandboxPDF