简单来说
一篇谈济慈诗作的论文,按文学期刊的样子排印。作者给每条文献起一个短代号写进正文,Postext按MLA格式在括号里印出作者和页码,并在文末列出引用文献。
成品一览
一份文学季刊里的论文:四页,讨论济慈《希腊古瓮颂》("Ode on a Grecian Urn")最后两行诗由谁说出。版面是150 × 230 mm的期刊页,正文用Spectral,节标题和书眉用Spectral SC;篇首放在一条黑釉色的色带里,下面压一道陶土红,取自阿提卡陶瓶的两种颜色。引文遵循MLA第9版,这是大多数文学和艺术史院系使用的格式:括号里写作者和页码;句中已提到作者时只写页码;同一作者有两部作品时加简短标题;引用文献表单独起页。正文里每条引文只是一个代号,样式只是一项设置。
这道食谱解答
- 怎样按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),
},
};
用料
- 类型
- 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 · 引用文献表单独起页
headingStyles: [{ id: 'works-cited', breakBefore: { enabled: true, parity: 'any' } }],
这个标题使用一个另起新页的样式,:::bibliography{title=""}把文献表放在它下面,不再重复标题。文献表按字母排序,悬挂缩进;济慈的第二部作品以三连划线代替姓名,这是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 mm,里面是栏目名、56 pt的Spectral Light斜体标题、副标题和署名,内容都取自标题属性。陶土红细条是第二个方框,锚定在色带底边以上3 mm处。
完整食谱
// ═══ 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上的食谱文件夹 ↗ (在新标签页中打开)
变化
#文献表紧接正文排
有的期刊把引用文献接在最后一段之后,不另起页,只要去掉标题样式里的分页。
- headingStyles: [{ id: 'works-cited', breakBefore: { enabled: true, parity: 'any' } }],
+ headingStyles: [{ id: 'works-cited', breakBefore: { enabled: false } }],#改用Chicago著者-出版年制
同一篇论文改用Chicago时,作者后面跟年份,写作"(Brooks 1947, 165)",文献表也随之改变。
- style: 'modern-language-association', // MLA 9th edition, author-page
+ style: 'chicago-author-date',常见问题
- citeproc-js按数据原样印出标题。MLA要求英文标题实词首字母大写,所以在文献数据里就要这样写。
致谢
- 文本
- 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)


