Zum Hauptinhalt springen
Rezept Nummer 93

Rezepte · Kapitel 5 · Buchaufbau

Ein Text in vier Zitierstilen

Ein kurzer Essay mit sechs Zitationen, gebaut in APA 7, Chicago Author-Date, IEEE und ISO 690: Nur die Einstellung des Stils ändert sich.

Auf dieser Seite
Ausgabe
Canvas
Stufe
Mittel
Postext
Getestet mit Postext 1.65.0
Erfordert ≥ 1.34.0
Lizenz
Aktualisiert am 16. Okt. 2026
Code MIT · Text CC BY 4.0

S. 1–1 · 1–2 von 4

  • Englisches Beispiel: noch keine deutsche Ausgabe
  • Endformat 155 × 235 mm
  • 1 Spalte
  • Source Serif 4 10/14
  • Source Sans 3
  • 4 Seiten
  • Stufe
  • Postext 1.57.1
  • In 271 ms gesetzt
  • 116 Zeilen Code

Kurz gesagt

Dieselben zwei Absätze über Typografie mit denselben Quellen, viermal gedruckt. Jede Seite zitiert auf eine andere Art, und Zitationen und Verzeichnis am Ende ändern sich mit, obwohl der Text nur einmal geschrieben wurde.

Was Sie setzen

Ein Essay aus zwei Absätzen darüber, warum gute Typografie unbemerkt bleibt, mit sechs Quellen: eine erzählende Zitation, eine mit Seite, eine, die den Autor weglässt, weil der Satz ihn nennt, und zwei gemeinsam zitierte Werke. Der Text wird viermal auf einer Seite von 155 × 235 mm gesetzt, und zwischen den vier Builds ändert sich nur citations.style: APA 7, Chicago Author-Date, IEEE und ISO 690. Jede Seite zeigt den Namen des Stils in einem Band in eigener Farbe, sodass sie nebeneinandergelegt eine Vergleichstafel ergeben. Die Zitationen ändern Form, Reihenfolge und Zeichensetzung, das Verzeichnis ändert seine Sortierung und seine Namen, und der Essay selbst ist dieselbe Datei.

Dieses Rezept beantwortet

  • Wie stelle ich ein Buch von einem Zitierstil auf einen anderen um, ohne den Text anzufassen?
  • Wie zitiere ich Werke und erstelle das Literaturverzeichnis nach APA, IEEE oder einem anderen Zitierstil?

Die kurze Antwort

script.js · Zeilen 28–47im vollständigen Code
// Citations are written once, Pandoc's way: [@key], [@a; @b], [-@key] without the author,
// @key [p. 17] inside the sentence. citeproc-js writes them, and the list, in the style named.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const SHOWN = [ // the same text, built once per entry
  { style: 'apa', band: 'apa', name: 'APA 7', system: t({ en: 'author-date', es: 'autor-año' }) },
  { style: 'chicago-author-date', band: 'chicago', name: 'Chicago',
    system: t({ en: 'author-date', es: 'autor-año' }) },
  { style: 'ieee', band: 'ieee', name: 'IEEE', system: t({ en: 'numbered', es: 'numérico' }) },
  { style: t({ en: 'iso690-author-date-en', es: 'iso690-author-date-es' }), band: 'iso',
    name: 'ISO 690', system: t({ en: 'author-date', es: 'autor-año' }) },
];
const citations = (style) => ({
  style, // 'apa' → '(Warde, 1955)'; 'ieee' → '[1]'; the list is sorted and set to match
  link: true,
  // The authors' names stay whole in the citations, the text and the list: the APA build
  // set '(Lup-' | 'ton, 2010)'.
  hyphenateNames: false,
  bibliography: { fontSize: em(0.85), lineHeight: pt(11.2), hangingIndent: mm(6),
    entrySpacing: pt(2), labelWidth: mm(6), doi: 'hide' },
});

Zutaten

Schrift
Source Serif 4, Source Sans 3 (SIL OFL 1.1)
Dateien
Keine: Jedes Bild wird im Code gezeichnet

Zubereitung

#1 · Eine Einstellung

Der Code steht oben in der kurzen Antwort. Die Zitationen werden einmal im Inhalt geschrieben, in der Syntax von Pandoc, und die Quellen stehen in einem BibTeX-Block am Ende. citations.style gibt einen CSL-Stil an, und citeproc-js erzeugt daraus jede Zitation und jeden Eintrag: APA setzt ein Komma vor das Jahr und sortiert zwei Werke nach Autor, Chicago behält die Reihenfolge, in der sie geschrieben wurden, IEEE macht daraus Nummern in der Reihenfolge der ersten Erwähnung, ISO 690 setzt die Nachnamen im Verzeichnis in Großbuchstaben. Für ein Buch, an dem noch geschrieben wird, ist das die ganze Änderung: ein Wert in der Konfiguration, und der Text bleibt unberührt.

#2 · Vier Builds, zwei Doppelseiten

script.js · Zeilen 150–157im vollständigen Code
// The style is set for the whole document, so each style is a build of its own.
const docs = [];
for (at = 0; at < SHOWN.length; at++) {
  // pageIndexOffset makes each page the next one of a book, so the desk pairs them:
  // APA beside Chicago, IEEE beside ISO 690.
  const content = { markdown, continuation: { pageIndexOffset: at + 1 } };
  docs.push(await buildDocumentWithFonts(content, config(), kitFonts(FONTS)));
}

Der Stil gilt für das ganze Dokument; die vier Fassungen sind also vier Builds desselben Markdowns. Jeder erhält ein pageIndexOffset, das um eins höher ist als das vorige, wodurch seine Seite zur nächsten Seite eines gedachten Buchs wird; der Tisch ordnet sie dann zu zwei Doppelseiten, wobei die beiden Autor-Jahr-Stile, die sich am wenigsten unterscheiden, nebeneinander liegen.

#3 · Der Name des Stils in einem Band

script.js · Zeilen 51–74im vollständigen Code
// The kicker names the build's citation style: a label of the design (#849).
const kicker = (s, i) => `${t({ en: 'Citation style', es: 'Estilo de cita' })}`
  + ` · ${i + 1} / ${SHOWN.length} · ${s.system}`;
const opener = (s, i) => ({
  enabled: true,
  minHeight: mm(41), // from the top margin to under the title, 63 mm from the trim
  slot: { elements: [
    { kind: 'box', id: 'band', style: { backgroundColor: col(s.band) },
      placement: { anchor: { to: 'page', edge: 'top-left' },
        size: { width: 'fill', height: mm(44) } } },
    { kind: 'text', id: 'kicker', content: kicker(s, i), fontFamily: SANS, fontSize: pt(8),
    fontWeight: 600, letterSpacing: pt(1.4), textTransform: 'uppercase', color: col('paper'),
    align: 'left',
    placement: { anchor: { to: 'page', edge: 'top-left' }, offset: { x: mm(18), y: mm(12) } } },
    { kind: 'text', id: 'name', content: s.name, fontFamily: SERIF, fontSize: pt(54),
      fontWeight: 600, lineHeight: 1, color: col('paper'), align: 'left', overflow: 'clip',
      placement: { anchor: { to: '#kicker', edge: 'below' }, offset: { x: mm(0), y: mm(5) },
        size: { width: mm(119), height: 'auto' } } },
    { kind: 'text', id: 'title', content: '{titleText}', fontFamily: SERIF, fontSize: pt(20),
      fontWeight: 600, lineHeight: 1.15, color: col('ink'), align: 'left', overflow: 'wrap',
      placement: { anchor: { to: 'page', edge: 'top-left' }, offset: { x: mm(18), y: mm(52) },
        size: { width: mm(119), height: 'auto' } } },
  ] },
});

Die Gestaltung der Überschrift zeichnet das Band vom Endformat aus, die Dachzeile mit Nummer und System des Stils und den Namen zu 54 pt. Name und System stammen aus dem Skript, nicht aus dem Markdown, weil der Text in allen vier Dokumenten derselbe ist.

script.js · Zeilen 15–22im vollständigen Code
const palette = {
  ink: '#1d1b19', muted: '#66605a', rule: '#cfc8bf', paper: '#ffffff',
  apa: '#2f5d8a', chicago: '#8c2f2b', ieee: '#24476b', iso: '#3c6b4f', // the four bands
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
// Each document points main-color at its own band, so any default left follows it.
const colorPalette = (band) => Object.entries({ ...palette, 'main-color': palette[band] })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));

Jedes Dokument richtet main-color auf sein eigenes Band; die vier Farben sind daher verknüpfte Einträge der Palette, und jede Voreinstellung, die die Konfiguration nicht festlegt, folgt dem Band ihrer Seite.

Das ganze Rezept

Sandbox
// ═══ Postext Cookbook · Nº 093 · One text in four citation styles ════════════════
// https://postext.dev/en/cookbook/one-text-four-citation-styles
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Source Serif 4, Source Sans 3 (SIL OFL 1.1) · Needs postext ≥ 1.34.0
import {
  buildDocumentWithFonts, renderPageToCanvas, registerCitationEngine,
} from 'https://esm.sh/postext';
import { createCiteprocEngine, STYLES, LOCALES } from 'https://esm.sh/postext-citeproc';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'one-text-four-citation-styles';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: one ink, and a colour for each style's band
const palette = {
  ink: '#1d1b19', muted: '#66605a', rule: '#cfc8bf', paper: '#ffffff',
  apa: '#2f5d8a', chicago: '#8c2f2b', ieee: '#24476b', iso: '#3c6b4f', // the four bands
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
// Each document points main-color at its own band, so any default left follows it.
const colorPalette = (band) => Object.entries({ ...palette, 'main-color': palette[band] })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const [SERIF, SANS] = ['Source Serif 4', 'Source Sans 3'];
const LEAD = 14; // pt

// #region answer: the style is one setting; everything else stays the same
// Citations are written once, Pandoc's way: [@key], [@a; @b], [-@key] without the author,
// @key [p. 17] inside the sentence. citeproc-js writes them, and the list, in the style named.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const SHOWN = [ // the same text, built once per entry
  { style: 'apa', band: 'apa', name: 'APA 7', system: t({ en: 'author-date', es: 'autor-año' }) },
  { style: 'chicago-author-date', band: 'chicago', name: 'Chicago',
    system: t({ en: 'author-date', es: 'autor-año' }) },
  { style: 'ieee', band: 'ieee', name: 'IEEE', system: t({ en: 'numbered', es: 'numérico' }) },
  { style: t({ en: 'iso690-author-date-en', es: 'iso690-author-date-es' }), band: 'iso',
    name: 'ISO 690', system: t({ en: 'author-date', es: 'autor-año' }) },
];
const citations = (style) => ({
  style, // 'apa' → '(Warde, 1955)'; 'ieee' → '[1]'; the list is sorted and set to match
  link: true,
  // The authors' names stay whole in the citations, the text and the list: the APA build
  // set '(Lup-' | 'ton, 2010)'.
  hyphenateNames: false,
  bibliography: { fontSize: em(0.85), lineHeight: pt(11.2), hangingIndent: mm(6),
    entrySpacing: pt(2), labelWidth: mm(6), doi: 'hide' },
});
// #endregion

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

#Einen Notenstil ausprobieren

Mit Chicago Notes and Bibliography wird jede Zitation zur Fußnote und die Liste zur Bibliografie; der Text ändert sich weiterhin nicht.

-  { style: 'apa', band: 'apa', name: 'APA 7', system: t({ en: 'author-date', es: 'autor-año' }) },
+  { style: 'chicago-notes-bibliography', band: 'apa', name: 'Chicago', system: 'notes' },

#Die Nummern hochgestellt schreiben

Ein nummerierter Stil kann sein Verzeichnis behalten und die Zitationen als hochgestellte Ziffern setzen, wie Nature und Vancouver.

-  link: true,
+  link: true, marker: 'superscript',

Häufige Fehler

  • Eine Fundstellenangabe wird einmal geschrieben, und jeder Stil setzt dafür sein eigenes Wort: hier in allen vier „p. 17“. Der mitgelieferte spanische Stil ISO 690 setzt „p.“ für jede Art von Fundstelle, auch für einen Abschnitt oder ein Kapitel; deshalb zitiert dieser Text eine Seite.
  • Auflagennummern gehören in BibTeX als Zahlen (edition = {3}): Jeder Stil schreibt dann auf seine Weise „3rd ed.“, „3.ª ed.“ oder „3.“. Steht dort „3rd“, wird das Wort unverändert übernommen, und die eigene Form des Stils geht verloren.

Nachweise

Text
Eigener Text, CC BY 4.0
Schriften
Source Serif 4 (SIL OFL 1.1) · Source Sans 3 (SIL OFL 1.1)
Sandbox