En poques paraules
Un assaig sobre com les ciutats britàniques van adoptar l'hora de Londres. Cada font que cita l'autora es converteix en una nota numerada a peu de pàgina, i la llista d'obres va al final.
Què compondràs
Una separata de la sèrie d'història de la tècnica d'una revista: un assaig d'unes 1.100 paraules sobre com les ciutats britàniques van deixar el seu propi migdia pel de Londres entre 1840 i 1880. La pàgina fa 156 × 234 mm, amb marges en mirall, en Crimson Pro d'11/14 pt, i una banda verd ferrocarril cobreix la meitat superior de la primera. L'autora escriu cada font com una clau, [@howse1980, 87], i Postext compon cadascuna com una nota numerada a peu de pàgina en l'estil de notes i bibliografia de Chicago. La primera nota d'una obra dona autor, títol i editorial; les següents, la forma breu. Les notes pròpies de l'autora prenen el número de la mateixa sèrie, i la bibliografia tanca l'assaig.
Aquesta recepta respon a
- Com poso les cites en notes a peu de pàgina, a l'estil de Chicago, amb forma breu en les següents?
- Com cito obres i componc la bibliografia en APA, IEEE o un altre estil de cita?
La resposta curta
// 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') },
};
Ingredients
- Funcions
- Cites en notesCites en un estil de citaBibliografia a partir de les referènciesNotes a peu de pàginaObertures dissenyadesAtributs de títolCapçaleres i folisMarges simètricsEstils de paràgrafPaleta de color semànticaExportació a PDF
- També fa servir
- Referències creuadesColor del paperCapçaleres segons el tipus de pàginaFonts incrustades al PDF
- Tipografia
- Crimson Pro, IBM Plex Sans Condensed (SIL OFL 1.1)
- Recursos
- Cap: totes les imatges es dibuixen en codi
Elaboració
#1 · Una nota per a cada citació
El codi és la resposta curta de més amunt. chicago-notes-bibliography és un estil de notes: una citació deixa al text un número volat i les seves paraules passen a una nota a peu de pàgina, numerada juntament amb les [^notas] de l'autora; notes: 'footnote' ho diu de manera explícita. citeproc-js porta el compte de les obres ja citades, així que la nota 3 diu Derek Howse, Greenwich Time and the Discovery of the Longitude (Oxford University Press, 1980), 87 i la nota 4, que torna al mateix llibre, Howse, Greenwich Time and the Discovery of the Longitude, 90–91. L'estil inclòs és la 18a edició del Manual de Chicago, que abandona ibid. i repeteix la forma breu, de manera que les notes 11 i 12 la imprimeixen dues vegades.
#2 · Les notes de l'autora també citen
Una citació dins d'una [^nota] es queda en aquella nota i es compon en línia, completa si és la primera vegada que apareix l'obra: la nota 1 és la frase de l'autora seguida de la referència completa de Schivelbusch. Tota citació acaba amb el punt de l'estil, així que una nota que acaba en una citació no porta punt propi al Markdown.
#3 · Prefixos, sufixos i localitzadors
[véase @simmons1991, 346–47; y @bartky2000, cap. 9] posa véase davant de la primera obra, separa les dues amb punt i coma i conserva el localitzador de cadascuna. Un número tot sol és una pàgina; cap. i chap. indiquen un capítol en qualsevol dels dos idiomes. El text que segueix el localitzador és un sufix: [@howse1980, 82–84, sobre los relojes de las diligencias] imprimeix la frase darrere de les pàgines.
#4 · L'obertura va en una banda
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) },
] },
};
La banda baixa 122 mm des del tall i el text comença 9 mm per sota. Les dates surten d'un atribut del títol, years="1840–1880", en Crimson Pro Light de 54 pt, perquè la targeta mostri una xifra tan gran com un títol; l'atribut de la signatura alimenta a més la capçalera de les pàgines parelles.
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' } }));
La recepta completa
// ═══ 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 = 'es'; // @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') },
L'script.js compost funciona tal com és: enganxa'l com a script de mòdul en qualsevol pàgina o obre la recepta a CodePen. Carpeta de la recepta a GitHub ↗ (s'obre en una pestanya nova)
Variants
#Porta les notes al final
Algunes revistes reuneixen les notes després de l'assaig; les citacions conserven les formes completa i breu.
- placement: 'column', numbering: 'chapter',
+ placement: 'chapterEnd', numbering: 'chapter',#Torna a escriure ibid.
La 17a edició de l'estil de Chicago imprimeix ibid. a la nota que repeteix l'obra anterior. Enganxa el fitxer .csl d'aquest estil, del repositori d'estils de Zotero, en una cadena i fes-lo servir com a estil propi.
- style: 'chicago-notes-bibliography', // CMOS 18th edition, notes and bibliography
+ style: 'custom', customStyle: CHICAGO_17TH_CSL, // the XML of the .csl fileErrors freqüents
- No tanquis amb punt una nota que acaba en una citació: l'estil ja hi posa el seu, i Postext no fon els dos, així que la nota acabaria amb dos punts.
- En un estil de notes,
@howse1980sense claudàtors deixa a la frase només el número de la nota, Com ¹ diu, sense el nom de l'autor. Escriu tu el nom i cita entre claudàtors:Com diu Howse,[@howse1980].
Crèdits
- Recepta
- Ignacio Ferro
- Text
- Text original, CC BY 4.0
- Fonts
- Crimson Pro (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)
- Codi
- MIT, com Postext
Editar aquest text ↗ (s'obre en una pestanya nova)Carpeta de la recepta a GitHub ↗ (s'obre en una pestanya nova)


