Коротко
Эссе о стихотворении Китса, как в литературном журнале. Автор пишет короткий код каждого источника; Postext печатает автора и страницу в скобках и список литературы в конце, в стиле MLA.
Что получится
Эссе из литературного ежеквартальника: четыре страницы о том, кто произносит две последние строки «Оды греческой вазе» Китса. Страница журнальная, 150 × 230 мм, набрана Spectral; заголовки разделов и колонтитулы шрифтом Spectral SC, а на начальной полосе чёрное поле цвета лака над полосой красной глины: это два цвета аттической вазы. Ссылки по MLA 9, стилю большинства кафедр литературы и истории искусства: автор и страница в скобках, одна страница, если автора называет фраза, краткое заглавие, если у автора две работы, и список Works Cited на отдельной странице. Каждая ссылка в тексте — ключ, а стиль — одна настройка.
Рецепт отвечает на вопросы
- Как ссылаться на источники и собирать список литературы в APA, IEEE или другом стиле?
Короткий ответ
// The text cites with [@keats-letters, 48] → (Keats, Letters 48): MLA prints the author
// and the page, and adds a short title when two works share an author. [-@eliot1932, 230]
// drops the name the sentence already gives → (230). The list is alphabetical, and a
// second work by the same author opens with a dash (MLA's ---) instead of the name.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'modern-language-association', // MLA 9th edition, author-page
link: true, // a citation jumps to its entry in Works Cited
bibliography: {
// MLA's half-inch hanging indent, scaled to a 108 mm measure.
fontSize: em(0.94), lineHeight: pt(13.4), hangingIndent: em(2.2), entrySpacing: pt(3),
},
};
Ингредиенты
- Возможности
- Ссылки в стиле цитированияСписок литературы по ссылкамОформленные начальные полосыАтрибуты заголовковСтили заголовковКолонтитулы и колонцифрыЗеркальные поляСтили абзацевСемантическая палитраЭкспорт в PDF
- Также применяет
- Перекрёстные ссылкиЦвет бумагиКолонтитулы по роли страницыШрифты, встроенные в PDFЯвный вертикальный отступ
- Шрифты
- Spectral, Spectral SC (SIL OFL 1.1)
- Материалы
- Нет: все иллюстрации рисует код
Порядок работы
#1 · Стиль MLA, данные BibTeX
Код приведён выше, в разделе «Короткий ответ». Движок ссылок регистрируется один раз, citations.style называет встроенный стиль MLA, и citeproc-js по нему пишет каждую ссылку и список. Записи стоят в блоке :::references{format=bibtex} в конце эссе, в том виде, в каком их выгружает менеджер библиографии. Для двух работ Китса MLA нужно краткое заглавие, и его даёт поле shorttitle записи (в CSL поле называется title-short).
#2 · Четыре вида ссылок
Текст ссылается на работу через [@jack1967], что печатает «(Jack)», потому что эссе говорит о книге целиком. Со страницей [@keats-letters, 41] печатает «(Keats, Letters 41)»: процитированы две работы Китса, и citeproc добавляет краткое заглавие, чтобы их различить. Если критика уже назвала фраза, [-@eliot1932, 230] опускает имя и печатает «(230)». Ссылка в тексте без страницы, @stillinger1974 records, печатает одно имя, «Stillinger records», с одним пробелом после него: ставить в скобки MLA здесь нечего. Когда ода уже процитирована с номерами строк, дальнейшие цитаты из неё несут одни номера, набранные в обычных скобках, как MLA и разрешает.
#3 · Блочная цитата со ссылкой после точки
// More than four lines of prose go in a Markdown blockquote: in ink, indented, with no
// first-line indent. Its citation follows the final full stop, as MLA asks.
const blockquote = {
color: col('ink'), italic: false, indent: em(2), firstLineIndent: em(0),
};
Письмо о Negative Capability длиннее четырёх строк прозы, поэтому выделено как цитата Markdown: прямым шрифтом, чёрным, с отступом 2 em и без абзацного отступа. MLA ставит ссылку блочной цитаты после конечной точки, и исходник делает так же: …fact and reason. [@keats-letters, 48]. :::space{lines=0.5} сверху и снизу отделяет цитату от абзацев вокруг.
#4 · Works Cited на отдельной странице
headingStyles: [{ id: 'works-cited', breakBefore: { enabled: true, parity: 'any' } }],
Заголовок получает стиль с переходом на новую страницу, а :::bibliography{title=""} ставит под ним список без второго заголовка. Список идёт по алфавиту с обратным отступом, а вторая работа Китса начинается тире в три em вместо имени, как MLA требует для повторного автора. Колонцифра внизу печатается на этой странице и на начальной, где нет колонтитулов.
#5 · Начальная полоса в двух цветах вазы
const BAND = 116; // mm from the trim's top
const opener = {
enabled: true,
minHeight: mm(BAND - MARGIN.top + 4), // the text starts a line under the band
slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('glaze') },
placement: { ...at('page', 'top-left'), size: { width: 'fill', height: mm(BAND) } } },
{ kind: 'box', id: 'foot', style: { backgroundColor: col('clay') },
placement: { ...at('page', 'top-left', 0, BAND - 3), size: { width: 'fill',
height: mm(3) } } },
{ kind: 'text', id: 'kicker', content: '{attr.kicker}', fontFamily: LABEL, fontWeight: 600,
fontSize: pt(9), letterSpacing: pt(1.6), color: col('slip'), align: 'left',
placement: at('container', 'top-left', 0, 6) },
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: TEXT, fontWeight: 300,
italic: true, fontSize: pt(56), lineHeight: 0.95, color: col('paper'), align: 'left',
overflow: 'wrap', placement: { ...at('container', 'top-left', -1, 30),
size: { width: mm(110), height: 'auto' } } },
{ kind: 'text', id: 'sub', content: '{attr.sub}', fontFamily: TEXT, fontWeight: 300,
fontSize: pt(13), lineHeight: 1.25, color: col('paper'), align: 'left', overflow: 'wrap',
placement: { ...at('container', 'top-left', 0, 66),
size: { width: mm(96), height: 'auto' } } },
{ kind: 'text', id: 'byline', content: '{attr.byline}', fontFamily: LABEL, fontWeight: 600,
fontSize: pt(9.5), letterSpacing: pt(1.2), color: col('slip'), align: 'left',
placement: at('container', 'top-left', 0, 82) },
] },
};
const palette = {
ink: '#1f1a17', glaze: '#231c19', clay: '#9a3d22', slip: '#e3a27e', rule: '#c9bdb0',
muted: '#6b6159', paper: '#fffdf9',
};
// Every colour is linked to its palette entry by id.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.clay })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
Поле глубиной 116 мм содержит надзаголовок, заглавие курсивом Spectral Light, 56 пт, подзаголовок и имя автора, всё из атрибутов заголовка. Глиняная полоса — второй прямоугольник, привязанный на 3 мм выше низа поля.
Рецепт целиком
// ═══ Postext Cookbook · Nº 096 · A humanities essay with MLA works cited ══════════
// https://postext.dev/en/cookbook/mla-humanities-essay
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Spectral, Spectral SC (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 = 'mla-humanities-essay';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: the black glaze and the red clay of an Attic vase
const palette = {
ink: '#1f1a17', glaze: '#231c19', clay: '#9a3d22', slip: '#e3a27e', rule: '#c9bdb0',
muted: '#6b6159', paper: '#fffdf9',
};
// Every colour is linked to its palette entry by id.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.clay })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const TEXT = 'Spectral', LABEL = 'Spectral SC';
const TRIM = { width: 150, height: 230 }; // a literary quarterly
const MARGIN = { top: 22, bottom: 22, inner: 19, outer: 21 };
const LEAD = 14.4; // pt
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
// #region answer: MLA 9 author-page citations and a Works Cited list
// The text cites with [@keats-letters, 48] → (Keats, Letters 48): MLA prints the author
// and the page, and adds a short title when two works share an author. [-@eliot1932, 230]
// drops the name the sentence already gives → (230). The list is alphabetical, and a
// second work by the same author opens with a dash (MLA's ---) instead of the name.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'modern-language-association', // MLA 9th edition, author-page
link: true, // a citation jumps to its entry in Works Cited
bibliography: {
// MLA's half-inch hanging indent, scaled to a 108 mm measure.
fontSize: em(0.94), lineHeight: pt(13.4), hangingIndent: em(2.2), entrySpacing: pt(3),
},
};
// #endregion
// #region quotation: a block quotation, set in and upright
// More than four lines of prose go in a Markdown blockquote: in ink, indented, with no
Собранный script.js работает как есть: вставьте его в модульный скрипт любой страницы или откройте рецепт на CodePen. Папка рецепта на GitHub ↗ (открывается в новой вкладке)
Варианты
#Продолжите список сразу после эссе
Журнал, который ставит Works Cited после последнего абзаца без новой страницы, убирает разрыв из стиля заголовка.
- headingStyles: [{ id: 'works-cited', breakBefore: { enabled: true, parity: 'any' } }],
+ headingStyles: [{ id: 'works-cited', breakBefore: { enabled: false } }],#Ссылайтесь по Chicago author-date
То же эссе в стиле Chicago ставит год после автора, «(Brooks 1947, 165)», и список меняется вместе с ним.
- style: 'modern-language-association', // MLA 9th edition, author-page
+ style: 'chicago-author-date',Частые ошибки
- citeproc-js печатает заглавия так, как они заданы в данных. MLA пишет английские заглавия с прописных букв, поэтому так их и записывайте в источниках.
Источники и лицензии
- Рецепт
- Ignacio Ferro
- Текст
- Quotations from “Ode on a Grecian Urn” (1820) · John Keats · общественное достояние
- Quotations from two letters of 1817, in Letters of John Keats to His Family and Friends, ed. Sidney Colvin (1925) · John Keats · общественное достояние
- Шрифты
- Spectral (SIL OFL 1.1) · Spectral SC (SIL OFL 1.1)
Изменить описание рецепта ↗ (открывается в новой вкладке)Папка рецепта на GitHub ↗ (открывается в новой вкладке)


