In short
An essay on how British towns came to keep London time. Each source the author cites becomes a numbered note at the foot of the page, and the list of works comes at the end.
What you'll build
An offprint from a journal’s history-of-technology series: an essay of about 1,100 words on how British towns gave up their own noon for London’s between 1840 and 1880. The page is 156 × 234 mm, mirrored, in Crimson Pro at 11/14 pt, with a railway-green band over the top half of the first page. The author writes every source as a key, [@howse1980, 87], and Postext sets each one as a numbered note at the foot of the page in Chicago notes-and-bibliography style. The first note for a work gives author, title and publisher; every later one gives the short form. The author’s own discursive notes take their numbers from the same sequence, and the bibliography closes the essay.
This recipe answers
- How do I set citations as footnotes, Chicago style, with short forms for later citations?
- How do I cite works and build the bibliography in APA, IEEE or another citation style?
The short answer
// The text cites with [@howse1980, 87]; a note style turns every citation into a
// footnote. The first note for a work gives it in full, later ones in the short form
// (author, short title, page), and the bibliography lists the works by author.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'chicago-notes-bibliography', // CMOS 18th edition, notes and bibliography
notes: 'footnote', // each citation in a note at the foot of the page
link: true, // a note's citation jumps to its bibliography entry
bibliography: { fontSize: em(0.92), lineHeight: pt(13), hangingIndent: em(1.8),
entrySpacing: pt(3) },
};
// The citation notes share the numbering and the look of the author's own [^notes].
const footnotes = {
placement: 'column', numbering: 'chapter',
fontSize: pt(8.5), lineHeight: pt(10.75), spaceBetween: pt(2),
textAlign: 'left', // ragged: the gap after a note's number stays the same in every note
separator: { width: 0.3, lineWidth: pt(0.5), color: col('rule') },
};
Chicago notes and bibliography, one note per citation
Ingredients
- Features
- Citations in notesCitations in a citation styleBibliography from the referencesFootnotesDesigned openersHeading attributesRunning heads and foliosMirrored marginsParagraph stylesSemantic colour palettePDF export
- Type
- Crimson Pro, IBM Plex Sans Condensed (SIL OFL 1.1)
- Assets
- None: every picture is drawn in code
Method
#1 · A note for every citation
The code is the short answer above. chicago-notes-bibliography is a note style, so a citation in the text leaves a superscript number and its words go to a footnote numbered with the author’s own [^notes]; notes: 'footnote' says so explicitly. citeproc-js tracks which works it has already cited, so note 3 reads Derek Howse, Greenwich Time and the Discovery of the Longitude (Oxford University Press, 1980), 87 and note 4, citing the same book again, reads Howse, Greenwich Time and the Discovery of the Longitude, 90–91. The bundled style is the 18th edition of the Chicago Manual, which drops Ibid. and repeats the short form, so notes 11 and 12 print the short form twice.
#2 · Notes the author writes cite too
A citation inside a [^note] stays in that note and is set inline, in full if it is the work’s first appearance: note 1 is the author’s sentence followed by Schivelbusch’s full reference. Every citation ends with the style’s full stop, so a note that closes on a citation needs no full stop of its own in the Markdown.
#3 · Prefixes, suffixes and locators
[see @simmons1991, 346–47; and @bartky2000, chap. 9] puts see before the first work, separates the two with a semicolon and keeps each work’s locator. A bare number is a page; chap. and cap. name a chapter in either language. Text after the locator is a suffix: [@howse1980, 82–84, on the mail-coach timepieces] prints the phrase after the pages.
#4 · The opener sits in a band
const BAND = 122; // mm from the trim's top
const opener = {
enabled: true,
minHeight: mm(BAND - MARGIN.top + 9), // the text starts 9 mm under the band
slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('green') },
placement: { ...at('page', 'top-left'), size: { width: 'fill', height: mm(BAND) } } },
{ kind: 'text', id: 'kicker', content: '{attr.kicker}', fontFamily: LABEL, fontWeight: 600,
fontSize: pt(7.5), letterSpacing: pt(1.4), textTransform: 'uppercase', color: col('tint'),
align: 'left', placement: at('container', 'top-left', 0, 4) },
{ kind: 'text', id: 'years', content: '{attr.years}', fontFamily: TEXT, fontWeight: 300,
fontSize: pt(54), lineHeight: 1, color: col('tint'), align: 'left',
placement: at('container', 'top-left', -1, 16) },
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: TEXT, fontWeight: 600,
fontSize: pt(25), lineHeight: 1.08, color: col('paper'), align: 'left', overflow: 'wrap',
placement: { ...at('container', 'top-left', 0, 47),
size: { width: mm(112), height: 'auto' } } },
{ kind: 'text', id: 'byline', content: '{attr.byline}', fontFamily: LABEL, fontWeight: 600,
fontSize: pt(9), letterSpacing: pt(0.6), color: col('tint'), align: 'left',
placement: at('container', 'top-left', 0, 92) },
] },
};
The band runs 122 mm down from the trim and the text starts 9 mm below it. The dates come from a heading attribute, years="1840–1880", set in Crimson Pro Light at 54 pt, so the card shows a figure as large as a title; the byline attribute also feeds the running head on the versos.
const palette = {
ink: '#211d1a', green: '#24493d', tint: '#dfe8e2', rule: '#b7b0a4', muted: '#6a645b',
paper: '#fbf9f4',
};
// col() links a colour to its palette entry; the hex is the value the entry holds today.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.green })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
The whole recipe
// ═══ Postext Cookbook · Nº 089 · A history essay with Chicago notes ═══════════════
// https://postext.dev/en/cookbook/history-essay-chicago-notes
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Crimson Pro, IBM Plex Sans Condensed (SIL OFL 1.1) · Needs postext ≥ 1.25.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerCitationEngine,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
import { createCiteprocEngine, STYLES, LOCALES } from 'https://esm.sh/postext-citeproc';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'history-essay-chicago-notes';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a railway green for the opener band, ink and warm paper for the rest
const palette = {
ink: '#211d1a', green: '#24493d', tint: '#dfe8e2', rule: '#b7b0a4', muted: '#6a645b',
paper: '#fbf9f4',
};
// col() links a colour to its palette entry; the hex is the value the entry holds today.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.green })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const TEXT = 'Crimson Pro', LABEL = 'IBM Plex Sans Condensed';
const TRIM = { width: 156, height: 234 }; // a journal offprint, trimmed like a trade book
const MARGIN = { top: 22, bottom: 22, inner: 20, outer: 17 };
const LEAD = 14; // pt
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
// #region answer: Chicago notes and bibliography, one note per citation
// The text cites with [@howse1980, 87]; a note style turns every citation into a
// footnote. The first note for a work gives it in full, later ones in the short form
// (author, short title, page), and the bibliography lists the works by author.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'chicago-notes-bibliography', // CMOS 18th edition, notes and bibliography
notes: 'footnote', // each citation in a note at the foot of the page
link: true, // a note's citation jumps to its bibliography entry
bibliography: { fontSize: em(0.92), lineHeight: pt(13), hangingIndent: em(1.8),
entrySpacing: pt(3) },
};
// The citation notes share the numbering and the look of the author's own [^notes].
const footnotes = {
placement: 'column', numbering: 'chapter',
fontSize: pt(8.5), lineHeight: pt(10.75), spaceBetween: pt(2),
textAlign: 'left', // ragged: the gap after a note's number stays the same in every note
separator: { width: 0.3, lineWidth: pt(0.5), color: col('rule') },
The composed script.js runs as it is: paste it into any page’s module script, or open the recipe on CodePen. Recipe folder on GitHub ↗ (opens in a new tab)
Variations
#Put the notes at the end
Some journals collect the notes after the essay; the citations keep their full and short forms.
- placement: 'column', numbering: 'chapter',
+ placement: 'chapterEnd', numbering: 'chapter',#Write Ibid. again
The 17th edition of the Chicago style prints Ibid. for a note that repeats the previous work. Paste that style’s .csl file, from the Zotero style repository, into a string and use it as a custom style.
- style: 'chicago-notes-bibliography', // CMOS 18th edition, notes and bibliography
+ style: 'custom', customStyle: CHICAGO_17TH_CSL, // the XML of the .csl filePitfalls
- Do not end a note with a full stop after a citation: the style already closes the citation with one, and Postext does not merge the two, so the note would end in two full stops.
- In a note style,
@howse1980without brackets leaves only the note number in the sentence, As ¹ says, with no author’s name. Write the name yourself and cite in brackets:As Howse says,[@howse1980].
Credits
- Recipe
- Ignacio Ferro
- Text
- Original prose, CC BY 4.0
- Fonts
- Crimson Pro (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)
Edit this write-up ↗ (opens in a new tab)Recipe folder on GitHub ↗ (opens in a new tab)


