# Σημειώσεις τέλους σε δική τους σελίδα, σε δύο στήλες

> Ένας μικρός προεπεξεργαστής αριθμεί τις σημειώσεις [^1] και τις μαζεύει κάτω από μια επικεφαλίδα Notes, που τις βάζει σε δική τους σελίδα, σε δύο στήλες.

- Έκδοση HTML: https://postext.dev/el/cookbook/endnotes-instead-of-footnotes
- Συνταγή Αρ. 020 · Πλαίσια και σημειώσεις · Επίπεδο 2 (Μεσαίο) · Έξοδοι: Canvas
- Είδη: Επιστημονικά άρθρα και ακαδημαϊκά κείμενα
- Απαιτεί postext ≥ 1.25.0 · δοκιμασμένη με 1.93.0 στις 2026-11-23
- Σελίδες: [15](https://postext.dev/cookbook/endnotes-instead-of-footnotes/en/p01.webp?v=ee5b7a17), [16](https://postext.dev/cookbook/endnotes-instead-of-footnotes/en/p02.webp?v=ee5b7a17), [17](https://postext.dev/cookbook/endnotes-instead-of-footnotes/en/p03.webp?v=ee5b7a17), [18](https://postext.dev/cookbook/endnotes-instead-of-footnotes/en/p04.webp?v=ee5b7a17), [19](https://postext.dev/cookbook/endnotes-instead-of-footnotes/en/p05.webp?v=ee5b7a17)
- Άνοιγμα στο Sandbox: https://postext.dev/el/sandbox#recipe=endnotes-instead-of-footnotes&lang=en (.postext: https://postext.dev/cookbook/endnotes-instead-of-footnotes/en/endnotes-instead-of-footnotes.postext)
- Τελευταία ενημέρωση: 2026-10-10
- Άλλες γλώσσες: [en](https://postext.dev/en/cookbook/endnotes-instead-of-footnotes.md), [es](https://postext.dev/es/cookbook/endnotes-instead-of-footnotes.md), [ca](https://postext.dev/ca/cookbook/endnotes-instead-of-footnotes.md), [de](https://postext.dev/de/cookbook/endnotes-instead-of-footnotes.md), [fr](https://postext.dev/fr/cookbook/endnotes-instead-of-footnotes.md), [it](https://postext.dev/it/cookbook/endnotes-instead-of-footnotes.md), [pt](https://postext.dev/pt/cookbook/endnotes-instead-of-footnotes.md), [zh](https://postext.dev/zh/cookbook/endnotes-instead-of-footnotes.md), [ja](https://postext.dev/ja/cookbook/endnotes-instead-of-footnotes.md), [ar](https://postext.dev/ar/cookbook/endnotes-instead-of-footnotes.md)

## Με λίγα λόγια

Μια μικρή έκδοση μιας διάσημης επιστημονικής διάλεξης για ένα κερί. Δείχνει πώς συγκεντρώνονται οι σημειώσεις στο τέλος, σε δική τους σελίδα με δύο στήλες, αντί για το κάτω μέρος κάθε σελίδας.

## Τι θα στοιχειοθετήσετε

Τη Διάλεξη I του έργου *The Chemical History of a Candle* του Michael Faraday, στοιχειοθετημένη ως μικρή έκδοση για τον αναγνώστη σε σελίδα 156 × 234 mm. Η διάλεξη ανοίγει σε ένα πεδίο αιθάλης με ένα αναμμένο κερί που στέκεται στην κάτω άκρη του, μια φωτογραφία φτιαγμένη με μοντέλα διάχυσης της οποίας το μαύρο ταιριάζει με την αιθάλη, και το κείμενο τρέχει σε μία στήλη με πλήρη στοίχιση σε Libre Bodoni. Εκεί όπου ένα βιβλίο θα έβαζε υποσημειώσεις, μικροί υπερυψωμένοι αριθμοί σε σκούρο πορτοκαλί στέλνουν τον αναγνώστη στο τέλος της διάλεξης. Οι σημειώσεις ακολουθούν σε δική τους σελίδα, κάτω από μια λουρίδα αιθάλης με το κερί σβησμένο, σε δύο στήλες με στοίχιση αριστερά και στοιχεία 8,2 pt, με κάθε έντονο αριθμό να κρέμεται στην εσοχή. Τρεις από τις έξι είναι του William Crookes, από την ανατύπωση του 1908 της έκδοσής του του 1861· οι άλλες τρεις είναι νέες και υπογράφονται *Ed.* Οι δύο στήλες τελειώνουν στην ίδια γραμμή και ο κολοφώνας κλείνει τη δεύτερη.

**Αυτή η συνταγή απαντά:**

- Πώς στοιχειοθετώ τις σημειώσεις [^1] ως σημειώσεις τέλους, σε δική τους σελίδα κάτω από μια επικεφαλίδα;
- Πώς στοιχειοθετώ βιβλιογραφία ή γλωσσάριο (κρεμαστή εσοχή, μικρότερα στοιχεία);
- Πώς γράφω εκθέτες, δείκτες και χημικούς τύπους χωρίς πλήρη μαθηματικά;

## Η σύντομη απάντηση

```js
// script.js, γραμμές 29–56
// Use: buildDocument({ markdown: endnotes(markdown) }, config()), with a 'note' paragraph style.
// [^label] in the text → **^n^**, numbered by first citation; bold, so it takes bodyText.boldColor.
// The [^label]: definitions (one line each) print where the first stood, a 'note' paragraph each:
// '**n** text', never '1. text', which would open a numbered list (gotcha: digit-period-list).
function endnotes(markdown, style = 'note') {
  const notes = new Map(); // label → text
  const HOLE = '\u0000'; // marks where a definition stood: the first becomes the notes
  const text = markdown.replace(/^\[\^([^\]\s]+)\]:[ \t]*(.+)\n?/gm,
    (_, label, note) => { notes.set(label, note.trim()); return HOLE; });
  const cited = []; // labels in order of first citation
  const number = (label) => {
    if (!notes.has(label)) throw new Error(`The note [^${label}] has no definition`);
    if (!cited.includes(label)) cited.push(label);
    return cited.indexOf(label) + 1;
  };
  // Markers side by side share one superscript, [^a][^b] → **^1,2^**, never 12 raised (note 12).
  // Word joiners (U+2060, no width) around the stars: '*Royal George*' and ** would make '***',
  // and ** between a letter and a caret opens no bold (CommonMark): the asterisks would print.
  const marked = text.replace(/(?:\[\^[^\]\s]+\])+/g, (run) => {
    const numbers = [...run.matchAll(/\[\^([^\]\s]+)\]/g)].map(([, label]) => number(label));
    return `\u2060**\u2060^${numbers.join(',')}^\u2060**`;
  });
  const unused = [...notes.keys()].filter((label) => !cited.includes(label));
  if (unused.length) console.warn(`Notes never cited: ${unused.join(', ')}`);
  const entries = cited.map((label, i) => `**${i + 1}** ${notes.get(label)}`);
  const section = `:::paragraphs{style="${style}"}\n${entries.join('\n\n')}\n:::\n`;
  return marked.replace(HOLE, () => section).replaceAll(HOLE, ''); // () =>: '$&' stays text
}
```

## Υλικά

**Διδάσκει**

- [Εκθέτες και δείκτες](https://postext.dev/el/docs/document-format-inline.md#μορφοποίηση-μέσα-στη-γραμμή): Ανυψωμένο και χαμηλωμένο κείμενο γραμμένο μέσα στο ίδιο το Markdown, χωρίς MathJax: εκθέτες, τακτικά αριθμητικά, χημικοί τύποι, δείκτες σημειώσεων.
- [Βιβλιογραφίες και γλωσσάρια](https://postext.dev/el/docs/configuration-styles.md#στιλ-παραγράφων): Κατάλογοι αναφορών και γλωσσάρια σε μικρότερα γράμματα με κρεμαστή εσοχή, μία παράγραφος ανά λήμμα.
- [Γεωμετρία ενότητας](https://postext.dev/el/docs/configuration-styles.md#στιλ-επικεφαλίδων): Ένα στιλ επικεφαλίδας που αλλάζει τα περιθώρια και τη διάταξη στηλών για την ενότητά του, όπως ένας πρόλογος σε μία στήλη μέσα σε βιβλίο δύο στηλών.

**Χρησιμοποιεί επίσης**

- [Στιλ επικεφαλίδων](https://postext.dev/el/docs/configuration-styles.md#στιλ-επικεφαλίδων)
- [Εξισορρόπηση στηλών](https://postext.dev/el/docs/configuration-page-flow.md#εξισορρόπηση-στηλών)
- [Γραμμή στηλών](https://postext.dev/el/docs/configuration-page-layout.md#γραμμή-ανάμεσα-στις-στήλες)
- [Στιλ παραγράφων](https://postext.dev/el/docs/configuration-styles.md#στιλ-παραγράφων)
- [Διαφυγές και κυριολεκτικοί χαρακτήρες](https://postext.dev/el/docs/document-format.md#συμβάσεις-σύνταξης)
- [Έντονα, πλάγια και τα χρώματά τους](https://postext.dev/el/docs/configuration-text.md#κυρίως-κείμενο)
- [Παραπομπές που τοποθετούν εικόνες](https://postext.dev/el/docs/document-format-resources.md#παραπομπή-μέσα-στο-κείμενο-η-κύρια-μορφή)
- [Αριθμημένες λεζάντες](https://postext.dev/el/docs/document-format-resources.md#αρίθμηση-κατά-την-πρώτη-παραπομπή)
- [Προσαρμοσμένοι τύποι πόρων](https://postext.dev/el/docs/configuration-resources.md#τύποι-πόρων)
- [Στιλ λεζάντας](https://postext.dev/el/docs/configuration-resources.md#στιλ-λεζάντας)
- [Σχεδιασμένες εναρκτήριες σελίδες](https://postext.dev/el/docs/configuration-headings.md#πλάτος-και-προηγμένη-σχεδίαση)
- [Εικόνες στις σχεδιάσεις σελίδας](https://postext.dev/el/docs/configuration-headers-footers.md#στοιχεία-εικόνας)
- [Ιδιότητες επικεφαλίδων](https://postext.dev/el/docs/document-format.md#χαρακτηριστικά-επικεφαλίδων)
- [Τρέχουσες κεφαλίδες και αριθμοί σελίδας](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα)
- [Συμμετρικά περιθώρια](https://postext.dev/el/docs/configuration-page-layout.md#κατοπτρικά-περιθώρια)
- [Σημασιολογική χρωματική παλέτα](https://postext.dev/el/docs/configuration-fonts-colors-viewers.md#παλέτα-χρωμάτων)
- [Χρώμα χαρτιού](https://postext.dev/el/docs/configuration-page-layout.md#σελίδα)
- [Κεφαλίδες ανά ρόλο σελίδας](https://postext.dev/el/docs/configuration-headers-footers.md#στοιχεία-κειμένου)
- [Εικόνες και πίνακες ως πόροι](https://postext.dev/el/docs/document-format-resources.md#πόροι)

**Η διαμόρφωση με μια ματιά**

- [`bodyText`](https://postext.dev/el/docs/configuration-text.md#κυρίως-κείμενο), [`captionStyle`](https://postext.dev/el/docs/configuration-resources.md#στιλ-λεζάντας), [`colorPalette`](https://postext.dev/el/docs/configuration-fonts-colors-viewers.md#παλέτα-χρωμάτων), [`footer`](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα), [`header`](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα), [`headingStyles`](https://postext.dev/el/docs/configuration-styles.md#στιλ-επικεφαλίδων), [`headings`](https://postext.dev/el/docs/configuration-headings.md#επικεφαλίδες), [`layout`](https://postext.dev/el/docs/configuration-page-layout.md#διάταξη), [`locale`](https://postext.dev/el/docs/configuration-language.md#συλλαβισμός), [`page`](https://postext.dev/el/docs/configuration-page-layout.md#σελίδα), [`paragraphStyles`](https://postext.dev/el/docs/configuration-styles.md#στιλ-παραγράφων), [`resourceTypes`](https://postext.dev/el/docs/configuration-resources.md#τύποι-πόρων)

**API**

- [`buildDocumentWithFonts`](https://postext.dev/el/docs/configuration-programmatic-usage.md#φόρτωση-γραμματοσειρών-πριν-από-τη-σελιδοποίηση), [`prepareFonts`](https://postext.dev/el/docs/configuration-programmatic-usage.md#φόρτωση-γραμματοσειρών-πριν-από-τη-σελιδοποίηση), [`registerResourceImage`](https://postext.dev/el/docs/architecture.md#η-επιφάνεια-του-api), [`renderPageToCanvas`](https://postext.dev/el/docs/configuration-programmatic-usage.md#απόδοση-σελίδας-σε-bitmap)

**Γραμματοσειρές**

- Libre Bodoni (OFL-1.1), Besley (OFL-1.1), Archivo Narrow (OFL-1.1)

## Προετοιμασία

### 1 · Μετατρέψτε τις υποσημειώσεις σε σημειώσεις τέλους πριν από τη στοιχειοθεσία

Ο προεπεξεργαστής βρίσκεται στη [σύντομη απάντηση](https://postext.dev/el/cookbook/endnotes-instead-of-footnotes.md#η-σύντομη-απάντηση) παραπάνω. Το Postext στοιχειοθετεί μόνο του τις σημειώσεις `[^1]` ([υποσημειώσεις](https://postext.dev/el/docs/document-format-notes-references.md#υποσημειώσεις)), στο κάτω μέρος της στήλης που παραπέμπει σε αυτές ή, με `placement: 'chapterEnd'`, μετά το τελευταίο μπλοκ του κεφαλαίου. Και στις δύο περιπτώσεις μένουν στη στήλη του κεφαλαίου, στη γραμματοσειρά του κειμένου, κάτω από μια κοντή γραμμή. Αυτή η έκδοση δίνει στις σημειώσεις επικεφαλίδα, λουρίδα και σελίδα με δύο στήλες, και ένα στιλ επικεφαλίδας το κάνει αυτό μόνο για επικεφαλίδα γραμμένη στο Markdown. Γι’ αυτό το pen ξαναγράφει το Markdown πριν καλέσει το `buildDocument`, και η μηχανή δεν βλέπει ποτέ `[^1]`. Αριθμεί τους δείκτες με τη σειρά που το κείμενο παραπέμπει πρώτη φορά σε αυτούς και τοποθετεί όλους τους ορισμούς, με αυτή τη σειρά, εκεί όπου βρίσκεται ο πρώτος από αυτούς, κάτω από το `## Notes`. Κάθε σημείωση αρχίζει με `**1**`, αφού το `1. ` θα άνοιγε αριθμημένη λίστα. Ένας συνδετήρας λέξεων (U+2060) ανοίγει κάθε δείκτη· χωρίς αυτόν, τα `**` του δείκτη μετά το `*Royal George*` θα συναντούσαν τον αστερίσκο που κλείνει τα πλάγια ως `***` και οι αστερίσκοι θα τυπώνονταν.

### 2 · Κρατήστε τα έντονα για τους δείκτες

```js
// script.js, γραμμές 60–61
const markers = { boldColor: col('ember'), // **^n^**: a superscript at 58 % of the text size
  referenceBold: false }; // [Fig. 1] follows the bold colour, set roman
```

Ο προεπεξεργαστής γράφει κάθε δείκτη ως `**^n^**`. Τα καρέ (^) στοιχειοθετούν τον αριθμό στο 58% του μεγέθους του κειμένου, ανυψωμένο κατά το ένα τρίτο αυτού ([μορφοποίηση μέσα στη γραμμή](https://postext.dev/el/docs/document-format-inline.md#μορφοποίηση-μέσα-στη-γραμμή)), και τα έντονα του δίνουν το `bodyText.boldColor`, που είναι ελεύθερο επειδή ο Faraday δεν χρησιμοποιεί ποτέ έντονα. Ένα ψηφίο 5,8 pt χρειάζεται αντίθεση 4,5:1 με το χαρτί και η φλόγα φτάνει μόνο το 2,6:1, γι’ αυτό οι δείκτες παίρνουν τη σκουρότερη θράκα. Η παραπομπή `[Fig. 1]` στη [σελίδα 17](https://postext.dev/cookbook/endnotes-instead-of-footnotes/en/p03.webp?v=ee5b7a17) τυπώνεται στο ίδιο χρώμα, σε όρθια, επειδή το `referenceColor` παίρνει από προεπιλογή το χρώμα των εντόνων και το `referenceBold: false` αφαιρεί τα έντονα.

### 3 · Στοιχειοθετήστε τις σημειώσεις μικρότερες, με τον αριθμό στην κρεμαστή εσοχή

```js
// script.js, γραμμές 65–79
const NOTE = 8.2; // pt: the notes' size, about four fifths of the text
// The hang is a bold number and an en space, measured in the notes' face once the fonts are in:
// a bold 5 matches 2, 3 and 6 within 0.02 em (the 4 is 0.05 em wider, the 1 0.14 em narrower).
function hang(label = '5') { // from ten notes on, pass the widest label: hang('10')
  const ctx = new OffscreenCanvas(1, 1).getContext('2d');
  const width = (w, s) => { ctx.font = `${w} 100px "${TEXT}"`; return ctx.measureText(s).width; };
  return em((width(700, label) + width(400, ' ')) / 100);
}
// Ragged, as justifying would stretch the en space after each number.
const noteStyles = () => [{ id: 'note', fontSize: pt(NOTE), lineHeight: pt(NOTE * 1.3),
  textAlign: 'left', hangingIndent: hang() },
  // 22 pt above the colophon is copy-fitted: its last line and the first column's share a line.
  { id: 'colophon', fontFamily: LABEL, fontSize: pt(7), lineHeight: pt(9.2), color: col('muted'),
    textAlign: 'left', firstLineIndent: pt(0), marginTop: pt(22) },
];
```

Οι σημειώσεις είναι 8,2 pt σε διάστιχο 10,7 pt, περίπου τα τέσσερα πέμπτα του μεγέθους του κειμένου. Το pen μετρά το `hangingIndent` του στιλ σε Libre Bodoni μόλις φορτωθούν οι γραμματοσειρές: ένα έντονο 5 και ένα διάστημα en φτάνουν τα 1,12 em, έτσι η πρώτη λέξη κάθε σημείωσης στοιχίζεται με τις γραμμές συνέχειάς της ([στιλ παραγράφου](https://postext.dev/el/docs/configuration-styles.md#στιλ-παραγράφων)). Με τον αριθμό έξω, στην κρεμαστή εσοχή, οι σημειώσεις δεν χρειάζονται διάστημα μεταξύ τους. Στοιχειοθετούνται με στοίχιση αριστερά, επειδή η πλήρης στοίχιση θα τέντωνε το διάστημα en, και μια στήλη 55 mm με στοιχεία 8,2 pt σε πλήρη στοίχιση βγαίνει αραιή. Οι περισπωμένες (~) δίνουν δείκτες όπως τα καρέ δίνουν εκθέτες, όπως στο `C~25~H~52~` στη σημείωση 4 και στο `H~2~O` στη σημείωση 5.

### 4 · Δώστε στις σημειώσεις μια σελίδα με δύο στήλες

```js
// script.js, γραμμές 116–130
const BAND = 82; // mm from the trim's top: level with the foot of Figure 1 across the spread
// The band sets the reserve too, but the first grid line clear of it lies 3 mm under the soot:
const BAND_GAP = 5; // mm more of minHeight moves the notes down a line
const notesSection = { id: 'notes', // an opener page: the drop folio, no running heads
  breakBefore: { enabled: true, parity: 'any' }, span: 'page', // the next page, either side
  layout: { layoutType: 'double', gutterWidth: mm(6), // two columns of about 40 characters
    columnRule: { enabled: true, color: col('rule') } }, // and a hairline between them
  advancedDesign: { enabled: true, minHeight: mm(BAND - TOP + BAND_GAP), slot: { elements: [
    soot(BAND), art('snuffed', 32, 64, BAND, 12), series,
    text('kicker', '{attr.kicker}', LABEL, 9.5, 'flame', at('container', 'top-left', 0, 16),
      caps(9.5)),
    text('title', '{titleText}', DISPLAY, 52, 'wax', below('kicker', 0.5, 80), display),
    text('intro', '{attr.intro}', LABEL, 8.4, 'rule', below('title', 2.5, 92),
      { lineHeight: 1.3 }),
  ] } } };
```

Η επικεφαλίδα `## Notes {style="notes" …}` ανοίγει μια ενότητα της οποίας οι σελίδες παίρνουν τη διάταξη και τη σχεδίαση του στιλ. Το `parity: 'any'` την ξεκινά στην επόμενη σελίδα, μονή ή ζυγή, και το `span: 'page'` απλώνει τη λουρίδα και στις δύο στήλες, ώστε να φτάνει ως το κομμένο μέγεθος και η δεύτερη στήλη να αρχίζει από κάτω της ([στιλ επικεφαλίδων](https://postext.dev/el/docs/configuration-styles.md#στιλ-επικεφαλίδων)). Η λουρίδα ορίζει το δεσμευμένο ύψος, αλλά η πρώτη γραμμή του πλέγματος που την ξεπερνά βρίσκεται μόλις 3 mm κάτω από την αιθάλη, γι’ αυτό το `BAND_GAP` προσθέτει 5 mm στο `minHeight` και οι σημειώσεις αρχίζουν μία γραμμή πιο κάτω. Η λεπτή γραμμή ανάμεσα στις στήλες είναι το `columnRule` της δικής του `layout` του στιλ, έτσι τη σχεδιάζουν μόνο οι σελίδες των σημειώσεων. Η εξισορρόπηση στηλών είναι ενεργή από προεπιλογή και κόβει την τελευταία σελίδα ώστε οι δύο στήλες να τελειώνουν στην ίδια γραμμή ([εξισορρόπηση στηλών](https://postext.dev/el/docs/configuration-page-flow.md#εξισορρόπηση-στηλών)).

### 5 · Ανοίξτε τη διάλεξη σε ένα πεδίο αιθάλης

```js
// script.js, γραμμές 101–112
const FIELD = 112; // mm from the trim's top
// The field reaches below the heading, so it sets the reserve (gotcha: opener-reserves-anchored);
// the H1's default bottom margin (0.5 em of 18 pt) rides on it: the text starts a grid line lower.
const opener = { enabled: true,
  slot: { elements: [soot(FIELD), art('candle', 40, 100, FIELD, 10), series,
    text('kicker', '{attr.kicker}', LABEL, 9.5, 'flame', below('series', 17, 60), caps(9.5)),
    text('title', '{titleText}', DISPLAY, 48, 'wax', below('kicker', 1.5, 96), display),
    // 86 mm wide, so the subtitle breaks after a dash, never before one
    text('subtitle', '{attr.subtitle}', DISPLAY, 11.5, 'rule', below('title', 3.5, 86),
      { fontWeight: 500, italic: true, lineHeight: 1.3 }),
    text('byline', '{attr.byline}', LABEL, 7.6, 'rule', below('subtitle', 7, 84), caps(7.6)),
  ] } };
```

Το πεδίο είναι ένα πλαίσιο αγκυρωμένο στη σελίδα, και το κερί, ένα στοιχείο εικόνας με ένα JPEG, στέκεται στην κάτω άκρη του. Η διάλεξη έχει μία στήλη, και μια σχεδίαση που κρατιέται στη στήλη της βάφει παρ’ όλα αυτά εκεί όπου είναι αγκυρωμένα τα στοιχεία της, έτσι το πεδίο απλώνεται από το κομμένο μέγεθος σε όλο το πάνω και το πλάγιο περιθώριο. Ο υπέρτιτλος, ο υπότιτλος και η υπογραφή προέρχονται από τη γραμμή της επικεφαλίδας, `# A Candle {kicker="Lecture I" subtitle="…" byline="…"}`, έτσι η Διάλεξη II δεν θα χρειαζόταν νέο κώδικα. Το πεδίο φτάνει κάτω από την επικεφαλίδα και επομένως ορίζει το δεσμευμένο ύψος. Το προεπιλεγμένο κάτω περιθώριο της επικεφαλίδας, 0,5 em, προστίθεται σε αυτό και το κείμενο αρχίζει μία γραμμή του πλέγματος κάτω από την πρώτη γραμμή που ξεπερνά την αιθάλη. Ο υπότιτλος έχει πλάτος 86 mm ώστε να σπάει μετά από μια παύλα, ποτέ πριν από αυτήν.

### 6 · Χρησιμοποιήστε τη φλόγα πάνω στην αιθάλη και τη θράκα πάνω στο χαρτί

```js
// script.js, γραμμές 14–23
const palette = {
  ink: '#1f1c19', paper: '#fffdf8', // text and the soot of the fields; a warm white page
  flame: '#e08a1e', ember: '#a9560c', // kickers on soot (6:1); markers and numbers (5.1:1)
  wax: '#f6efe1', rule: '#d4c6ad', // type on soot; hairlines and small type on soot (10:1)
  muted: '#6d6356', blue: '#4f7cae', // running heads, colophon (5.8:1); a flame's blue foot
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
// The engine's defaults link to 'main-color': point it at the ember, so nothing prints blue.
const colorPalette = Object.entries({ ...palette, 'main-color': palette.ember })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
```

Το πορτοκαλί της φλόγας έχει αντίθεση 6:1 πάνω στην αιθάλη αλλά μόνο 2,6:1 πάνω στο χαρτί. Χρωματίζει τους υπέρτιτλους στις σκούρες λουρίδες και την Εικόνα 1· ό,τι μικρό τυπώνεται σε πορτοκαλί πάνω στο χαρτί (δείκτες, αριθμοί σημειώσεων, η ετικέτα της εικόνας) παίρνει τη σκουρότερη θράκα, με 5,1:1. Το `main-color` δείχνει στη θράκα, έτσι μια προεπιλογή που η ρύθμιση δεν επαναλαμβάνει ακολουθεί τη σχεδίαση αντί να τυπώνεται μπλε.

> Ένα σύντομο σχόλιο μπορεί να μείνει μέσα στο κείμενο, σε παρένθεση. Οι γλώσσες που χρειάζεται ο αναγνώστης δίπλα στη γραμμή μπορούν να πάνε σε μια πλευρική στήλη, όπως στο [Σχολικό βιβλίο με στήλη στο περιθώριο](https://postext.dev/el/cookbook/textbook-margin-column.md).

## Η πλήρης συνταγή

Ένα αρχείο, συντεθειμένο από τον φάκελο της συνταγής με το δείγμα κειμένου και το κοινό κιτ του Συνταγολογίου ενσωματωμένα· φτιάχνει τη δική του σελίδα. Για να το εκτελέσετε, βάλτε το σε ένα `<script type="module">` σε μια κενή σελίδα, ή επικολλήστε το στο πάνελ JS ενός νέου CodePen (ως module). Εισάγει το postext από το esm.sh, οπότε δεν χρειάζεται εγκατάσταση ούτε build.

- Φάκελος πηγής: https://github.com/drnachio/postext/tree/main/cookbook/endnotes-instead-of-footnotes

### script.js

```js
// ═══ Postext Cookbook · Nº 020 · Endnotes on a page of their own, in two columns ═════
// https://postext.dev/en/cookbook/endnotes-instead-of-footnotes
// Code: MIT · Text: Faraday, ed. Crookes (PD) · Notes, figure: CC BY 4.0 · Photos: diffusion models
// Fonts: Libre Bodoni, Besley, Archivo Narrow (SIL OFL 1.1) · Needs postext ≥ 1.25.0
import {
  buildDocumentWithFonts, prepareFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'endnotes-instead-of-footnotes';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: soot, wax and a flame; the ember is the flame dark enough for small type
const palette = {
  ink: '#1f1c19', paper: '#fffdf8', // text and the soot of the fields; a warm white page
  flame: '#e08a1e', ember: '#a9560c', // kickers on soot (6:1); markers and numbers (5.1:1)
  wax: '#f6efe1', rule: '#d4c6ad', // type on soot; hairlines and small type on soot (10:1)
  muted: '#6d6356', blue: '#4f7cae', // running heads, colophon (5.8:1); a flame's blue foot
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
// The engine's defaults link to 'main-color': point it at the ember, so nothing prints blue.
const colorPalette = Object.entries({ ...palette, 'main-color': palette.ember })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const TEXT = 'Libre Bodoni', DISPLAY = 'Besley', LABEL = 'Archivo Narrow'; // text; titles; labels
const TOP = 22, INNER = 18, OUTER = 22; // mm: margins, and a 116 mm measure of 74 characters

// #region answer: Markdown footnotes become raised markers and a Notes section
// Use: buildDocument({ markdown: endnotes(markdown) }, config()), with a 'note' paragraph style.
// [^label] in the text → **^n^**, numbered by first citation; bold, so it takes bodyText.boldColor.
// The [^label]: definitions (one line each) print where the first stood, a 'note' paragraph each:
// '**n** text', never '1. text', which would open a numbered list (gotcha: digit-period-list).
function endnotes(markdown, style = 'note') {
  const notes = new Map(); // label → text
  const HOLE = '\u0000'; // marks where a definition stood: the first becomes the notes
  const text = markdown.replace(/^\[\^([^\]\s]+)\]:[ \t]*(.+)\n?/gm,
    (_, label, note) => { notes.set(label, note.trim()); return HOLE; });
  const cited = []; // labels in order of first citation
  const number = (label) => {
    if (!notes.has(label)) throw new Error(`The note [^${label}] has no definition`);
    if (!cited.includes(label)) cited.push(label);
    return cited.indexOf(label) + 1;
  };
  // Markers side by side share one superscript, [^a][^b] → **^1,2^**, never 12 raised (note 12).
  // Word joiners (U+2060, no width) around the stars: '*Royal George*' and ** would make '***',
  // and ** between a letter and a caret opens no bold (CommonMark): the asterisks would print.
  const marked = text.replace(/(?:\[\^[^\]\s]+\])+/g, (run) => {
    const numbers = [...run.matchAll(/\[\^([^\]\s]+)\]/g)].map(([, label]) => number(label));
    return `\u2060**\u2060^${numbers.join(',')}^\u2060**`;
  });
  const unused = [...notes.keys()].filter((label) => !cited.includes(label));
  if (unused.length) console.warn(`Notes never cited: ${unused.join(', ')}`);
  const entries = cited.map((label, i) => `**${i + 1}** ${notes.get(label)}`);
  const section = `:::paragraphs{style="${style}"}\n${entries.join('\n\n')}\n:::\n`;
  return marked.replace(HOLE, () => section).replaceAll(HOLE, ''); // () =>: '$&' stays text
}
// #endregion

// #region markers: the lecture has no bold of its own, so the bold colour is free for the markers
const markers = { boldColor: col('ember'), // **^n^**: a superscript at 58 % of the text size
  referenceBold: false }; // [Fig. 1] follows the bold colour, set roman
// #endregion

// #region notes: 8.2 pt, set ragged, each number hanging in the indent
const NOTE = 8.2; // pt: the notes' size, about four fifths of the text
// The hang is a bold number and an en space, measured in the notes' face once the fonts are in:
// a bold 5 matches 2, 3 and 6 within 0.02 em (the 4 is 0.05 em wider, the 1 0.14 em narrower).
function hang(label = '5') { // from ten notes on, pass the widest label: hang('10')
  const ctx = new OffscreenCanvas(1, 1).getContext('2d');
  const width = (w, s) => { ctx.font = `${w} 100px "${TEXT}"`; return ctx.measureText(s).width; };
  return em((width(700, label) + width(400, ' ')) / 100);
}
// Ragged, as justifying would stretch the en space after each number.
const noteStyles = () => [{ id: 'note', fontSize: pt(NOTE), lineHeight: pt(NOTE * 1.3),
  textAlign: 'left', hangingIndent: hang() },
  // 22 pt above the colophon is copy-fitted: its last line and the first column's share a line.
  { id: 'colophon', fontFamily: LABEL, fontSize: pt(7), lineHeight: pt(9.2), color: col('muted'),
    textAlign: 'left', firstLineIndent: pt(0), marginTop: pt(22) },
];
// #endregion

// Design text, set left; it wraps where a folio or a running head would end in an ellipsis.
const text = (id, content, family, size, color, placement, extra) => ({ kind: 'text', id,
  content, fontFamily: family, fontSize: pt(size), color: col(color), placement,
  overflow: 'wrap', align: 'left', ...extra });
const caps = (s) => ({ fontWeight: 600, textTransform: 'uppercase', letterSpacing: pt(s * 0.18) });
const display = { fontWeight: 800, lineHeight: 1 }; // the titles, set solid
const at = (to, edge, x, y, width) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) },
  ...(width && { size: { width: mm(width) } }) });
const below = (id, y, width) => at(`#${id}`, 'below', 0, y, width);
// A field of soot from the trim's top, edge to edge, and a candle standing on its lower edge.
const soot = (height) => ({ kind: 'box', id: 'soot', style: { backgroundColor: col('ink') },
  placement: { ...at('page', 'top-left', 0, 0), size: { width: 'fill', height: mm(height) } } });
const art = (id, width, height, foot, x) => ({ kind: 'image', id, resourceId: id,
  placement: at('page', 'top-right', -x, foot - height, width) });

const series = text('series', '{title}', LABEL, 7.6, 'rule', at('container', 'top-left', 0, 4),
  caps(7.6)); // the book's title, from the frontmatter, heads both bands

// #region opener: the lecture opens on a field of soot with a photo of a lit candle
const FIELD = 112; // mm from the trim's top
// The field reaches below the heading, so it sets the reserve (gotcha: opener-reserves-anchored);
// the H1's default bottom margin (0.5 em of 18 pt) rides on it: the text starts a grid line lower.
const opener = { enabled: true,
  slot: { elements: [soot(FIELD), art('candle', 40, 100, FIELD, 10), series,
    text('kicker', '{attr.kicker}', LABEL, 9.5, 'flame', below('series', 17, 60), caps(9.5)),
    text('title', '{titleText}', DISPLAY, 48, 'wax', below('kicker', 1.5, 96), display),
    // 86 mm wide, so the subtitle breaks after a dash, never before one
    text('subtitle', '{attr.subtitle}', DISPLAY, 11.5, 'rule', below('title', 3.5, 86),
      { fontWeight: 500, italic: true, lineHeight: 1.3 }),
    text('byline', '{attr.byline}', LABEL, 7.6, 'rule', below('subtitle', 7, 84), caps(7.6)),
  ] } };
// #endregion

// #region section: the notes open a page of their own, in two columns under a band of soot
const BAND = 82; // mm from the trim's top: level with the foot of Figure 1 across the spread
// The band sets the reserve too, but the first grid line clear of it lies 3 mm under the soot:
const BAND_GAP = 5; // mm more of minHeight moves the notes down a line
const notesSection = { id: 'notes', // an opener page: the drop folio, no running heads
  breakBefore: { enabled: true, parity: 'any' }, span: 'page', // the next page, either side
  layout: { layoutType: 'double', gutterWidth: mm(6), // two columns of about 40 characters
    columnRule: { enabled: true, color: col('rule') } }, // and a hairline between them
  advancedDesign: { enabled: true, minHeight: mm(BAND - TOP + BAND_GAP), slot: { elements: [
    soot(BAND), art('snuffed', 32, 64, BAND, 12), series,
    text('kicker', '{attr.kicker}', LABEL, 9.5, 'flame', at('container', 'top-left', 0, 16),
      caps(9.5)),
    text('title', '{titleText}', DISPLAY, 52, 'wax', below('kicker', 0.5, 80), display),
    text('intro', '{attr.intro}', LABEL, 8.4, 'rule', below('title', 2.5, 92),
      { lineHeight: 1.3 }),
  ] } } };
// #endregion

const head = (id, content, parity, edge, x, extra) => ({ kind: 'text', id, content, parity,
  pages: 'body', fontFamily: LABEL, fontSize: pt(7.6), color: col('muted'), ...caps(7.6),
  placement: at('page', edge, x, 13), ...extra });
const folio = { fontFamily: DISPLAY, fontSize: pt(8.6), fontWeight: 700, color: col('ink'),
  letterSpacing: pt(0) }; // untracked figures
const header = { elements: [ // the book on the verso, the lecture on the recto, folios outside
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
  head('verso-title', '{title}', 'even', 'top-left', OUTER + 9),
  head('recto-title', '{attr.kicker} · {chapterTitle}', 'odd', 'top-right', -(OUTER + 9)),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };
const dropFolio = text('drop', '{pageNumber}', DISPLAY, 8.6, 'ink', at('page', 'bottom', 0, -12),
  { fontWeight: 700, align: 'center', pages: 'opener' }); // the lecture's and the notes' openers

const config = () => ({ locale: 'en-us', // the sample is in English
  colorPalette, header, footer: { elements: [dropFolio] },
  page: { width: mm(156), height: mm(234), dpi: 150, // a trade octavo
    backgroundColor: col('paper'), margins: { top: mm(TOP), bottom: mm(23), left: mm(INNER),
      right: mm(OUTER), mirror: true } }, // left is the inner margin
  layout: { layoutType: 'single' },
  bodyText: { fontFamily: TEXT, fontSize: pt(10), lineHeight: pt(13.8), color: col('ink'),
    italicColor: col('ink'), ...markers, firstLineIndent: mm(4.5), indentAfterHeading: false,
    minWordSpacing: 0.85, maxWordSpacing: 1.8 }, // the loosest lines reach 1.78 under any cap
  headings: { fontFamily: DISPLAY, color: col('ink'), levels: [
    // parity 'odd': the next recto; the default 'always-odd' also leaves a blank page before it.
    { level: 1, breakBefore: { enabled: true, parity: 'odd' }, advancedDesign: opener },
  ] },
  headingStyles: [notesSection], paragraphStyles: noteStyles(),
  // One figure, numbered through the book: "Figure 1", not the chapter-scoped "Figure 1.1".
  resourceTypes: [{ id: 'figure', name: 'Figure', shortLabel: 'Fig.', captionPrefix: 'Figure',
    numberingTemplate: '{n}', resetOn: 'never', counterFormat: 'decimal' }],
  captionStyle: { fontFamily: LABEL, fontSize: pt(8.2), labelColor: col('ember') },
});

// ─── 2 · Content ────────────────────────────────────────────────────────────
const markdown = String.raw`---
title: "The Chemical History of a Candle"
author: "Michael Faraday"
---

# A Candle {kicker="Lecture I" subtitle="The Flame – Its Sources – Structure – Mobility – Brightness" byline="Michael Faraday · Christmas 1860"}

I purpose, in return for the honour you do us by coming to see what are our proceedings here, to bring before you, in the course of these lectures, the Chemical History of a Candle. I have taken this subject on a former occasion;[^christmas] and were it left to my own will, I should prefer to repeat it almost every year—so abundant is the interest that attaches itself to the subject, so wonderful are the varieties of outlet which it offers into the various departments of philosophy. There is not a law under which any part of this universe is governed which does not come into play, and is touched upon in these phenomena. There is no better, there is no more open door by which you can enter into the study of natural philosophy, than by considering the physical phenomena of a candle. I trust, therefore, I shall not disappoint you in choosing this for my subject rather than any newer topic, which could not be better, were it even so good.

But we must speak of candles as they are in commerce. Here are a couple of candles commonly called dips. They are made of lengths of cotton cut off, hung up by a loop, dipped into melted tallow, taken out again and cooled, then re-dipped until there is an accumulation of tallow round the cotton. In order that you may have an idea of the various characters of these candles, you see these which I hold in my hand—they are very small, and very curious. They are, or were, the candles used by the miners in coal mines. In olden times the miner had to find his own candles; and it was supposed that a small candle would not so soon set fire to the fire-damp in the coal mines as a large one; and for that reason, as well as for economy’s sake, he had candles made of this sort—20, 30, 40, or 60 to the pound. They have been replaced since then by the steel-mill, and then by the Davy-lamp, and other safety-lamps of various kinds. I have here a candle that was taken out of the *Royal George*[^george], it is said, by Colonel Pasley. It has been sunk in the sea for many years, subject to the action of salt water. It shews you how well candles may be preserved; for though it is cracked about and broken a good deal, yet, when lighted, it goes on burning regularly, and the tallow resumes its natural condition as soon as it is fused.

Mr. Field, of Lambeth, has supplied me abundantly with beautiful illustrations of the candle and its materials. I shall therefore now refer to them. And, first, there is the suet—the fat of the ox—Russian tallow, I believe, employed in the manufacture of these dips, which Gay Lussac, or some one who entrusted him with his knowledge, converted into that beautiful substance, stearin, which you see lying beside it. A candle, you know, is not now a greasy thing like an ordinary tallow candle, but a clean thing, and you may almost scrape off and pulverise the drops which fall from it without soiling anything. This is the process he adopted:[^stearin]—The fat or tallow is first boiled with quick-lime, and made into a soap, and then the soap is decomposed by sulphuric acid, which takes away the lime, and leaves the fat re-arranged as stearic acid, whilst a quantity of glycerin is produced at the same time. Glycerin—absolutely a sugar, or a substance similar to sugar—comes out of the tallow in this chemical change. The oil is then pressed out of it; and you see here this series of pressed cakes, shewing how beautifully the impurities are carried out by the oily part as the pressure goes on increasing, and at last you have left that substance which is melted, and cast into candles as here represented. The candle I have in my hand is a stearin candle, made of stearin from tallow in the way I have told you. Then here is a sperm candle, which comes from the purified oil of the spermaceti whale. Here also are yellow bees-wax and refined bees-wax, from which candles are made. Here, too, is that curious substance called paraffin, and some paraffin candles made of paraffin obtained from the bogs of Ireland.[^paraffin] I have here also a substance brought from Japan, since we have forced an entrance into that out-of-the-way place—a sort of wax which a kind friend has sent me, and which forms a new material for the manufacture of candles.

There is another condition which you must learn as regards the candle, without which you would not be able fully to understand the philosophy of it, and that is the vaporous condition of the fuel. In order that you may understand that, let me shew you a very pretty, but very common-place experiment. If you blow a candle out cleverly, you will see the vapour rise from it. You have, I know, often smelt the vapour of a blown-out candle—and a very bad smell it is; but if you blow it out cleverly, you will be able to see the vapour into which this solid matter is transformed. I will blow out one of these candles in such a way as not to disturb the air around it, by the continuing action of my breath; and now, if I hold a lighted taper two or three inches from the wick, you will observe a train of fire going through the air till it reaches the candle. I am obliged to be quick and ready, because, if I allow the vapour time to cool, it becomes condensed into a liquid or solid, or the stream of combustible matter gets disturbed.

Now, as to the shape or form of the flame. It concerns us much to know about the condition which the matter of the candle finally assumes at the top of the wick—where you have such beauty and brightness as nothing but combustion or flame can produce.[^combustion]

You have the glittering beauty of gold and silver, and the still higher lustre of jewels, like the ruby and diamond; but none of these rival the brilliancy and beauty of flame. What diamond can shine like flame? It owes its lustre at night-time to the very flame shining upon it. The flame shines in darkness, but the light which the diamond has is as nothing until the flame shine upon it, when it is brilliant again. The candle alone shines by itself, and for itself, or for those who have arranged the materials. Now, let us look a little at the form of the flame as you see it under the glass shade. It is steady and equal; and its general form is that which is represented in the diagram [:ref{id="flame"}], varying with atmospheric disturbances, and also varying according to the size of the candle. It is a bright oblong—brighter at the top than towards the bottom—with the wick in the middle, and besides the wick in the middle, certain darker parts towards the bottom, where the ignition is not so perfect as in the part above.

I can give you here a little further illustration, for the purpose of shewing you how flame goes up or down; according to the current. I have here a flame—it is not a candle-flame—but you can, no doubt, by this time, generalise enough to be able to compare one thing with another. What I am about to do is to change the ascending current that takes the flame upwards into a descending current. This I can easily do by the little apparatus you see before me. The flame, as I have said, is not a candle flame, but it is produced by alcohol, so that it shall not smoke too much. I will also colour the flame with another substance,[^copper] so that you may trace its course; for with the spirit alone you could hardly see well enough to have the opportunity of tracing its direction. By lighting this spirit-of-wine, we have then a flame produced; and you observe that when held in the air, it naturally goes upwards.

You understand now easily enough why flames go up under ordinary circumstances—it is because of the draught of air by which the combustion is formed. But now, by blowing the flame down, you see I am enabled to make it go downwards into this little chimney—the direction of the current being changed. Before we have concluded this course of lectures, we shall shew you a lamp in which the flame goes up and the smoke goes down, or the flame goes down and the smoke goes up. You see, then, that we have the power in this way of varying the flame in different directions.

It is too bad that we have not got further; but we must not, under any circumstances, keep you beyond your time. It will be a lesson to me in future to hold you more strictly to the philosophy of the thing, than to take up your time so much with these illustrations.

## Notes {style="notes" kicker="Lecture I" intro="The raised numbers in the lecture point here. Notes signed by the editor are new to this edition; the rest are William Crookes’s, from the impression of 1908."}

[^christmas]: Faraday first gave this course of six lectures at Christmas 1848. The text printed here is that of his second course, given at the Royal Institution in 1860–61 and published in 1861, edited by William Crookes. *Ed.*
[^george]: The *Royal George* sunk at Spithead on the 29th of August, 1782. Colonel Pasley commenced operations for the removal of the wreck by the explosion of gunpowder, in August, 1839. The candle which Professor Faraday exhibited must therefore have been exposed to the action of salt water for upwards of fifty-seven years.
[^stearin]: The fat or tallow consists of a chemical combination of fatty acids with glycerine. The lime unites with the palmitic, oleic, and stearic acids, and separates the glycerine. After washing, the insoluble lime soap is decomposed with hot dilute sulphuric acid. The melted fatty acids thus rise as an oil to the surface, when they are decanted. They are again washed and cast into thin plates, which, when cold, are placed between layers of cocoa-nut matting, and submitted to intense hydraulic pressure. In this way the soft oleic acid is squeezed out, whilst the hard palmitic and stearic acids remain. These are further purified by pressure at a higher temperature, and washing in warm dilute sulphuric acid, when they are ready to be made into candles. These acids are harder and whiter than the fats from which they were obtained, whilst at the same time they are cleaner and more combustible.
[^paraffin]: Paraffin wax is a mixture of hydrocarbons with 20 to 40 carbon atoms, such as C~25~H~52~. Karl von Reichenbach first isolated it from wood tar in 1830; by 1860 it was distilled for candles from shale, peat and coal. *Ed.*
[^combustion]: As it burns, the vapour of the wax combines with oxygen from the air and leaves the flame as water, H~2~O, and carbon dioxide, CO~2~, which Faraday calls “carbonic acid”. He finds the water in Lecture II and the carbonic acid in Lecture V. *Ed.*
[^copper]: The alcohol had chloride of copper dissolved in it: this produces a beautiful green flame.

:::paragraphs{style="colophon"}
Set in Libre Bodoni, Besley and Archivo Narrow, all three under the SIL Open Font License. The text is Michael Faraday’s, as edited by William Crookes in 1861, from the impression of 1908 (Project Gutenberg eBook 14474), abridged; the figure and the editor’s notes are CC BY 4.0.
:::
`; // content.<lang>.md, inlined by the Cookbook

const svgResource = (id, width, height, extra) => ({ id, typeId: 'figure', kind: 'svg',
  svg: { fileId: `${id}.svg`, width, height }, createdAt: 0, updatedAt: 0, ...extra });
// The candles on the bands are photographs, JPEGs in assets/ cut to their 40 × 100 and 32 × 64
// mm and declared at their pixels; their black was lifted to the soot's ink. Uncited: design only.
const photo = (id, bitmap) => ({ id, typeId: 'figure', kind: 'bitmap', bitmap, createdAt: 0,
  updatedAt: 0 });
const resources = [
  photo('candle', { fileId: 'candle-640.jpg', format: 'jpeg', width: 640, height: 1600 }),
  photo('snuffed', { fileId: 'snuffed-600.jpg', format: 'jpeg', width: 600, height: 1200 }),
  // Cited on page 17, the 'top' figure heads page 18 (gotcha: top-float-next-page).
  svgResource('flame', 2320, 1200, { placement: { position: 'top' }, caption: 'A candle flame as '
    + 'it looks under a glass shade (left) and in section (right): the dark core of wax vapour '
    + 'round the wick, the blue foot where the air first meets it, the bright zone where soot '
    + 'glows, and the faint mantle, the hottest part. Heated air rises round it and draws it up.',
    altText: 'A candle flame, whole and in section, with arrows of rising air' }),
];

// #region art: Figure 1, the flame as seen and in section, in the palette
// No words in the drawings: the caption names the parts. Arrowheads are paths
// (gotcha: svg-no-marker-filters).
const n = (v) => +v.toFixed(2);
const svg = (w, h, body) => `<svg xmlns="http://www.w3.org/2000/svg" width="${w * 10}" `
  + `height="${h * 10}" viewBox="0 0 ${w} ${h}">${body}</svg>`;
const shape = (d, fill, extra = '') => `<path d="${d}" fill="${fill}"${extra}/>`;
const line = (d, stroke, width, extra = '') => `<path d="${d}" fill="none" stroke="${stroke}" `
  + `stroke-width="${width}" stroke-linecap="round" stroke-linejoin="round"${extra}/>`;
const dot = (x, y, r, fill, extra = '') => `<circle cx="${n(x)}" cy="${n(y)}" r="${n(r)}" `
  + `fill="${fill}"${extra}/>`;
const op = (v) => ` fill-opacity="${v}"`;
// Light round a flame: a radial gradient from the flame's colour to nothing.
const halo = (x, y, r, strength) => `<radialGradient id="h${x}" cx="0.5" cy="0.5" r="0.5">`
  + `<stop offset="0" stop-color="${palette.flame}" stop-opacity="${strength}"/>`
  + `<stop offset="0.45" stop-color="${palette.flame}" stop-opacity="${strength * 0.35}"/>`
  + `<stop offset="1" stop-color="${palette.flame}" stop-opacity="0"/></radialGradient>`
  + dot(x, y, r, `url(#h${x})`);
// A flame from its foot (x, base) up to its tip: round below, drawn out above.
function tongue(x, base, top, half) {
  const h = base - top;
  return `M${n(x)} ${n(top)}C${n(x + half * 0.3)} ${n(top + h * 0.28)} ${n(x + half)} `
    + `${n(top + h * 0.5)} ${n(x + half)} ${n(top + h * 0.74)}`
    + `C${n(x + half)} ${n(base - h * 0.04)} `
    + `${n(x + half * 0.5)} ${n(base)} ${n(x)} ${n(base)}C${n(x - half * 0.5)} ${n(base)} `
    + `${n(x - half)} ${n(base - h * 0.04)} ${n(x - half)} ${n(top + h * 0.74)}C${n(x - half)} `
    + `${n(top + h * 0.5)} ${n(x - half * 0.3)} ${n(top + h * 0.28)} ${n(x)} ${n(top)}Z`;
}
// The flame's zones: mantle, bright body, dark core round the wick, blue foot.
function flameAt(x, base, top, half, { lit = true, section = false } = {}) {
  const h = base - top;
  const P = palette;
  let out = shape(tongue(x, base + 2, top - h * 0.08, half * 1.22), P.flame,
    section ? `${op(0.16)} stroke="${P.flame}" stroke-width="0.8"` : op(0.22));
  out += shape(tongue(x, base, top, half), P.flame);
  if (!section) { // as seen: brighter above, darker below
    out += shape(tongue(x, base - h * 0.22, top + h * 0.1, half * 0.72), P.wax, op(0.55))
      + shape(tongue(x, base - h * 0.38, top + h * 0.2, half * 0.42), P.wax, op(0.75));
  }
  out += shape(tongue(x, base, base - h * (section ? 0.5 : 0.36), half * (section ? 0.5 : 0.36)),
    section ? P.ink : P.ember, op(section ? 0.72 : 0.7));
  out += shape(`M${n(x - half * 0.95)} ${n(base - h * 0.1)}Q${n(x)} ${n(base + h * 0.06)} `
    + `${n(x + half * 0.95)} ${n(base - h * 0.1)}Q${n(x + half * 0.7)} ${n(base + h * 0.03)} `
    + `${n(x)} ${n(base + h * 0.03)}Q${n(x - half * 0.7)} ${n(base + h * 0.03)} `
    + `${n(x - half * 0.95)} ${n(base - h * 0.1)}Z`, P.blue, op(lit ? 0.9 : 0));
  return out;
}
// A pillar of wax from y down past the art's foot, with the cup of melted wax on top.
function pillar(x, y, half, foot, drip = 0) {
  const P = palette;
  const shade = `<linearGradient id="w${x}" x1="0" x2="1" y1="0" y2="0">` // rounded by light
    + `<stop offset="0" stop-color="${P.rule}"/><stop offset="0.3" stop-color="${P.wax}"/>`
    + `<stop offset="0.62" stop-color="${P.wax}"/><stop offset="1" stop-color="${P.rule}"/>`
    + '</linearGradient>';
  return shade + `<rect x="${n(x - half)}" y="${n(y)}" width="${n(half * 2)}" `
    + `height="${n(foot - y)}" fill="url(#w${x})"/>`
    + (drip ? shape(`M${n(x - half * 0.78)} ${n(y)}h${n(half * 0.34)}v${n(drip)}a${n(half * 0.17)} `
      + `${n(half * 0.17)} 0 0 1-${n(half * 0.34)} 0Z`, P.wax) : '')
    + `<ellipse cx="${n(x)}" cy="${n(y)}" rx="${n(half)}" ry="${n(half * 0.2)}" `
    + `fill="${P.wax}"/>`
    + `<ellipse cx="${n(x)}" cy="${n(y + half * 0.02)}" rx="${n(half * 0.76)}" `
    + `ry="${n(half * 0.13)}" fill="${P.rule}"${op(0.8)}/>`; // the cup of melted wax
}
const wick = (x, y, len, lean = 2) => line(`M${n(x)} ${n(y)}q${n(lean * 0.3)} ${n(-len * 0.5)} `
  + `${n(lean)} ${n(-len)}`, palette.ink, 1.6);
// Rising air: a curve from beside the foot to above the tip, and a path arrowhead.
function draught(x0, y0, x1, y1, color, width, opacity) {
  const head = shape(`M${n(x1 - 2.2)} ${n(y1 + 3.2)}L${n(x1)} ${n(y1 - 0.6)}L${n(x1 + 2.2)} `
    + `${n(y1 + 3.2)}Z`, color, op(opacity));
  return line(`M${n(x0)} ${n(y0)}C${n(x0)} ${n((y0 + y1) / 2)} ${n(x1)} ${n(y0 - (y0 - y1) * 0.6)} `
    + `${n(x1)} ${n(y1 + 2)}`, color, width, ` stroke-opacity="${opacity}"`) + head;
}
function flame() { // Figure 1: 116 × 60 mm, as seen and in section, on soot
  const P = palette;
  let out = `<rect width="232" height="120" rx="2" fill="${P.ink}"/>`;
  out += halo(70, 60, 46, 0.3) + flameAt(70, 92, 24, 11) + pillar(70, 100, 17, 120, 12)
    + wick(69.5, 101, 12) // then the glass shade, open below, drawn over the candle it stands round
    + `<path d="M47 112V17a5 5 0 0 1 5-5h36a5 5 0 0 1 5 5v95" fill="${P.wax}"${op(0.05)} `
    + `stroke="${P.rule}" stroke-opacity="0.4" stroke-width="0.8"/>`
    + line('M52 18v88', P.wax, 1.4, ' stroke-opacity="0.18"');
  for (const side of [-1, 1]) { // the air the flame heats, rising round it
    out += draught(160 + side * 32, 108, 160 + side * 10, 14, P.rule, 1, 0.75)
      + draught(160 + side * 44, 104, 160 + side * 22, 30, P.rule, 1, 0.5);
  }
  return svg(232, 120, out + flameAt(160, 92, 24, 11, { section: true })
    + pillar(160, 100, 17, 120) + wick(159.5, 101, 12));
}
const drawings = { flame };
// #endregion

// ─── 3 · Fonts ──────────────────────────────────────────────────────────────
// Every face the design uses, loaded before the first build.
const FONTS = { 'Libre Bodoni': ['400', '400i', '700'], // text and notes (700: the numbers)
  Besley: ['500i', '700', '800'], 'Archivo Narrow': ['400', '400i', '600', '700'] }; // labels

// ─── 4 · Build & show ───────────────────────────────────────────────────────
const source = endnotes(markdown); // the answer, run before the engine sees the text
await Promise.all([prepareFonts(source, config(), kitFonts(FONTS)),
  ...resources.filter((r) => r.bitmap).map(({ bitmap: b }) => loadImage(b.fileId, asset(b.fileId))),
  ...Object.entries(drawings).map(([id, draw]) => loadSvg(`${id}.svg`, draw()))]);
// The lecture starts on folio 15, a recto, 14 pages into the book (gotcha: parity-page1-recto).
const continuation = { pageIndexOffset: 14, pageNumbering: { startAt: 15 } };
const doc = await buildDocumentWithFonts({ markdown: source, resources, continuation }, config(),
  kitFonts(FONTS));
showPages(doc, { title: 'The Chemical History of a Candle, Lecture I' });

// ─── 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 · images v3 ── recipes with pictures · postext.dev/cookbook
/** Registers a photo or PNG for the canvas and keeps its bytes for the PDF.
 *  fetch → ImageBitmap never taints the canvas (a plain cross-origin <img> would). */
async function loadImage(fileId, url) {
  const res = await fetch(url);
  if (!res.ok) throw new Error(`Image not found (${res.status}): ${url}`);
  const bytes = new Uint8Array(await res.arrayBuffer());
  registerResourceImage(fileId, await createImageBitmap(new Blob([bytes])));
  (loadImage.bytes ??= new Map()).set(fileId, bytes);
}

/** Registers SVG markup as a vector image, its fonts inside (inlineSvgFonts, ≥ 1.25).
 *  `options` go to registerResourceImage: { singleInk: true } tints it on the canvas. */
async function loadSvg(fileId, svg, options) {
  if (typeof inlineSvgFonts === 'function') svg = await inlineSvgFonts(svg, svgFaces);
  const img = new Image();
  img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
  await img.decode();
  registerResourceImage(fileId, img, options);
  (loadImage.bytes ??= new Map()).set(fileId, new TextEncoder().encode(svg));
}

/** A face's Fontsource files: nearest weight; latin + what the SVG sets. */
async function svgFaces(family, weight, style, { codePoints = [] } = {}) {
  const [id, m] = [fontsourceId(family), await fontsourceMeta(family)];
  const w = m?.weights.reduce((a, b) => (Math.abs(b - weight) < Math.abs(a - weight) ? b : a)) ?? weight;
  const s = m?.styles.includes(style) === false ? 'normal' : style;
  return Promise.all(['latin', ...kitSubsetsFor(String.fromCodePoint(...codePoints), m)].map(async (x) => new Uint8Array(
    await (await fetch(`${await fontsourceAt(id)}files/${id}-${x}-${w}-${s}.woff2`)).arrayBuffer())));
}

/** renderToPdf({ resourceBytes: imageBytes }) */
function imageBytes(fileId) { return loadImage.bytes?.get(fileId); }

/** renderToHtml({ resourceImageUrl: imageUrl }) */
function imageUrl(fileId) {
  const bytes = imageBytes(fileId);
  if (!bytes) return undefined;
  imageUrl.urls ??= new Map();
  if (!imageUrl.urls.has(fileId)) {
    const type = /\.svg$/i.test(fileId) ? 'image/svg+xml' : /\.png$/i.test(fileId) ? 'image/png' : 'image/jpeg';
    imageUrl.urls.set(fileId, URL.createObjectURL(new Blob([bytes], { type })));
  }
  return imageUrl.urls.get(fileId);
}

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

## Παραλλαγές

### Αφήστε το Postext να στοιχειοθετήσει τις σημειώσεις

Αφαιρέστε το `endnotes()` και την επικεφαλίδα `## Notes`, βάλτε μια κενή γραμμή ανάμεσα στους ορισμούς (η μηχανή διαβάζει έναν ορισμό ως την επόμενη κενή γραμμή) και προσθέστε `footnotes: { placement: 'chapterEnd' }` στη ρύθμιση. Η μηχανή αριθμεί τους δείκτες και στοιχειοθετεί τις σημειώσεις στο τέλος της διάλεξης, μετά τον κολοφώνα, στη μία της στήλη· οι [Υποσημειώσεις στο κάτω μέρος της στήλης που τις αναφέρει](https://postext.dev/el/cookbook/novel-footnotes-column-foot.md) δίνουν στιλ σε σημειώσεις που στοιχειοθετεί η μηχανή.

### Σημειώστε τις σημειώσεις με το μελάνι

Αν το κείμενο χρησιμοποιεί έντονα για τη δική του έμφαση, τυπώστε τους δείκτες στο χρώμα του μελανιού, αφού το `boldColor` χρωματίζει εξίσου τους δείκτες και κάθε έντονη λέξη.

```diff
-const markers = { boldColor: col('ember'), // **^n^**: a superscript at 58 % of the text size
+const markers = { boldColor: col('ink'), // **^n^**: a superscript at 58 % of the text size
```

### Αφήστε τις στήλες των σημειώσεων ανισοϋψείς

Απενεργοποιήστε την εξισορρόπηση της τελευταίας σελίδας και η πρώτη στήλη γεμίζει ως το κάτω άκρο πριν αρχίσει η δεύτερη.

```diff
-  headings: { fontFamily: DISPLAY, color: col('ink'), levels: [
+  headings: { fontFamily: DISPLAY, color: col('ink'), balancing: { trailing: false }, levels: [
```

## Συνήθη λάθη

- **Το '1998. ' ή το '- ' στην αρχή παραγράφου ανοίγει λίστα.** Μια παράγραφος που αρχίζει με αριθμό, τελεία και κενό, ή με ενωτικό και κενό, γίνεται στοιχείο λίστας. Βάλτε έναν word joiner (U+2060) πριν από τον αριθμό και γράψτε τους διαλόγους με παύλα (—).
- **Ένα κινητό στοιχείο 'top' πηγαίνει στη σελίδα μετά την παραπομπή του, εκτός αν μπορεί να ανοίξει τη σελίδα της παραπομπής.** Από προεπιλογή ένα κινητό στοιχείο δεν μπαίνει ποτέ πάνω από την παραπομπή του, οπότε ένα κινητό στοιχείο 'top' πλάτους σελίδας που παραπέμπεται στη σελίδα Ν ανοίγει τη σελίδα Ν+1. Ορίστε placement.citingPage: true στον πόρο ή στο defaultPlacement του τύπου του (ή layout.floatsAtCitingPage για όλο το βιβλίο, από το postext 1.25), και τότε ανοίγει τη σελίδα Ν, με το κείμενο πάνω από την παραπομπή να κατεβαίνει κάτω από αυτό, όταν χωρά μέσα στο layout.maxTopFraction και η γραμμή της παραπομπής μένει σε αυτή τη σελίδα. Δεν ανοίγει ποτέ την πρώτη σελίδα ενός κεφαλαίου ή μια σελίδα μετά από αναγκαστική αλλαγή: εκεί εξακολουθεί να ανοίγει την επόμενη σελίδα, και τα 'auto' ή 'bottom' μπορούν να πάρουν το κάτω μέρος της σελίδας της παραπομπής.
- **Μια εναρκτήρια σελίδα δεσμεύει ύψος ως το χαμηλότερο στοιχείο της που είναι αγκυρωμένο στη σελίδα.** Μια εναρκτήρια σελίδα με προηγμένη σχεδίαση δεσμεύει το ύψος του χαμηλότερου στοιχείου της, και μετρούν επίσης τα στοιχεία αγκυρωμένα στη σελίδα ή στο περιθώριο αιμορραγίας κάτω από την επικεφαλίδα, οπότε μια διακόσμηση στο κάτω μέρος της σελίδας σπρώχνει το κείμενο στην επόμενη σελίδα. Δώστε σε ένα τέτοιο στοιχείο reserve: false (από το postext 1.5): ζωγραφίζεται εκεί όπου είναι αγκυρωμένο και δεν δεσμεύει τίποτα. Τα στοιχεία που ακολουθούν την ίδια την ταινία (αγκυρωμένα στο κάτω άκρο της ή με ύψος 'fill') δεν ορίζουν ποτέ το ύψος της.
- **Χωρίς <marker> ή φίλτρα στα SVG (εφεδρική ψηφιογραφία).** Μια εικόνα SVG μένει διανυσματική στο PDF μόνο χωρίς <marker>, φίλτρα και μάσκες· διαφορετικά μετατρέπεται σε ψηφιογραφία, και φίλτρα σε βαθιά εμφώλευση μπορεί να την αφήσουν κενή στο Chrome. Σχεδιάστε τις αιχμές των βελών ως διαδρομές.
- **Η σελίδα 1 είναι δεξιά: σχεδιάστε τις σελίδες με φυσικούς αριθμούς.** Η σελίδα 1 είναι δεξιά (μονή) σελίδα και η σελίδα 2 η πρώτη αριστερή (ζυγή), οπότε σχεδιάστε τα δισέλιδα με φυσικούς αριθμούς σελίδων: μια εναρκτήρια σελίδα σε ζυγή σελίδα βλέπει τη μονή σελίδα που ακολουθεί.

## Ευχαριστίες

- Συνταγή: Ignacio Ferro ([@drnachio](https://github.com/drnachio))
- Κείμενο: The Chemical History of a Candle, Lecture I (abridged), and William Crookes’s notes to it, from the Chatto & Windus impression of 1908: Michael Faraday; William Crookes ([πηγή](https://www.gutenberg.org/ebooks/14474)), κοινό κτήμα
- Κείμενο: The notes signed Ed., the colophon and the drawings: Ignacio Ferro, CC-BY-4.0
- Εικόνες: The lit candle on the lecture’s opener, a photograph: Generated With Diffusion Models, πρωτότυπο
- Εικόνες: The snuffed candle on the notes’ band, a photograph: Generated With Diffusion Models, πρωτότυπο
- Εικόνες: Figure 1, the flame as seen and in section, drawn in code in the page’s palette: Ignacio Ferro, CC-BY-4.0
- Γραμματοσειρές: Libre Bodoni (OFL-1.1), Besley (OFL-1.1), Archivo Narrow (OFL-1.1)
- Κώδικας: MIT · Δείγμα περιεχομένου: CC-BY-4.0

## Σχετικές συνταγές

- [Αρ. 032 · Σχολιασμένο κλασικό με σχόλια στο περιθώριο](https://postext.dev/el/cookbook/annotated-classic-glosses.md): Το τρελό τσάι της Αλίκης ως σχολιασμένη έκδοση: πράσινα και κόκκινα σχόλια στο έξω περιθώριο, δίπλα στις γραμμές τους, με ένα γράμμα στο χρώμα τους. · Επίπεδο 3 (Προχωρημένο) · Πεζογραφία, θέατρο και λογοτεχνικός λόγος
- [Αρ. 044 · Κριτική έκδοση: αριθμοί στίχων και σημειώσεις ανά στίχο](https://postext.dev/el/cookbook/critical-edition-line-numbers.md): Το Lycidas του Μίλτον του 1645: το lineNumbers αριθμεί κάθε πέμπτο στίχο στην πλευρική στήλη, και κάθε σημείωση ανοίγει με τον στίχο της σε ετικέτα. · Επίπεδο 3 (Προχωρημένο) · Ποίηση
- [Αρ. 031 · Τελικά μέρη διατριβής: παράρτημα, γλωσσάριο και ευρετήριο](https://postext.dev/el/cookbook/thesis-back-matter.md): Οι τελευταίες σελίδες διατριβής σε ασπρόμαυρο: παράρτημα με γράμμα, δίστηλο γλωσσάριο, βιβλιογραφία APA και ευρετήριο από σημάνσεις μέσα στο κείμενο. · Επίπεδο 3 (Προχωρημένο) · Επιστημονικά άρθρα και ακαδημαϊκά κείμενα
