简单来说
一篇中文学术期刊上的短论文。作者给每条文献起一个代号写进正文,Postext按引用顺序给文献编号,再按中文期刊的要求排出参考文献表。
成品一览
虚构的出版学期刊《示例出版研究》上一篇研究论文的两页,按国内高校学报的常见版式排出。开本16开,184 × 260 mm,双栏,每栏每行23个小五号字,行距15 pt,排在字格上。题名区通栏:靛蓝色色带上的刊名,黑体粗体题名,作者、作者单位,以及摘要和关键词。参考文献按国家标准GB/T 7714—2015《信息与文献 参考文献著录规则》的顺序编码制著录:每条文献按在正文中首次被引用的先后编号,序号加方括号排成上标,三个以上连续序号合并为一个范围。文献表中每条文献带文献类型标识,中文文献超过三位著者时写“等”,西文文献写“et al.”。按APA 7引用的学位论文章节用的是同一套引文写法,样式换成了著者-出版年制。
这道食谱解答
- 怎样按GB/T 7714著录引用,竖排也一样?
- 怎样按APA、IEEE或其他引用样式引用文献并生成参考文献表?
简短回答
// Register the engine once, before the first build. The GB/T 7714 numeric style writes
// superscript [n] in the order works are first cited, joins three or more in a row into a
// range and sets the list with its type codes: [M] book, [J] article, [D] thesis, [C]
// conference paper, [EB/OL] web page. Its CSL file holds a second layout for works whose
// language is English, with "et al." for 等: a Western entry takes "et al." and a Chinese
// one keeps 等, each chosen by the entry's `language`.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'china-national-standard-gb-t-7714-2015-numeric',
locale: 'zh-CN', // 等, 卷, 版 and the other terms of the list
bibliography: { fontSize: em(7.5 / BODY), lineHeight: pt(12), entrySpacing: pt(1.5),
labelWidth: em(1.7) }, // turnovers under the text, not past it: [1] and a space
};
用料
- 类型
- Noto Serif SC, Noto Sans SC, LXGW WenKai TC(SIL OFL 1.1)
- 素材
- 无:所有图片都用代码绘制
做法
#1 · 引用样式,以及它给西文文献准备的格式
代码就是上面的简短回答。引用引擎在第一次排版前注册一次,postext-citeproc自带GB/T 7714的三种样式:顺序编码制、著者-出版年制和注释体(引用)。正文里一条引文就是方括号里的一个代号。[@tinker1963]排出上标[1],[@rayner2016; @dyson2001; @lin2023]排出[2–4]。两个相邻的序号不合并,排成[5,6]。同一文献再次被引用时沿用第一次的序号:第三段里的[4],后文的[1]和[2]都是这样。
标准要求西文文献的前三位著者之后写“et al.”,中文文献写“等”。随包的CSL文件为此准备了两套格式,其中一套专用于英文文献,每条文献按自己的language字段选用格式:Rayner等五位著者写成“RAYNER K, SCHOTTER E R, MASSON M E J, et al.”,林岚等四位著者写成“林岚, 周明远, 陈思齐, 等”。locale: 'zh-CN'让文献表里的其余用语都用中文。
#2 · 用CSL-YAML块提供文献数据
文献数据写在Markdown末尾的:::references{format=csl-yaml}块里,格式与Zotero导出的CSL YAML相同(参考文献数据)。文献类型标识由CSL类型决定:book印[M],article-journal印[J],thesis印[D],paper-conference印[C],后接“//”和论文集,webpage印[EB/OL],引用日期放在方括号里。带DOI的期刊文章按标准标为[J/OL],并保留DOI。中文姓名写在literal里,样式就不会把它拆成姓和名。:::bibliography{title=""}把文献表放在不编号的标题“参考文献”之下,labelWidth让每条文献的转行与正文对齐,而不是缩得更深。

#3 · 色带上的题名区
const BAND = 30; // mm from the trim's top
const at = (id, edge, y) => ({ anchor: { to: id ? `#${id}` : 'container', edge },
offset: { y: mm(y) }, size: { width: mm(AREA) } });
const line = (id, content, family, size, color, placement, extra) => ({ kind: 'text', id,
content, fontFamily: family, fontSize: pt(size), color: col(color), align: 'center',
overflow: 'wrap', placement, ...extra });
const onBand = (x, y) => ({ anchor: { to: 'page', edge: 'top-left' },
offset: { x: mm(x), y: mm(y) }, size: { width: mm(AREA) } });
const [JOURNAL, ISSUE] = ['示例出版研究', '第44卷 第3期 2026年9月']; // the journal's band
const masthead = { enabled: true, minHeight: pt(9 * LEAD), slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('indigo') },
placement: { anchor: { to: 'page', edge: 'top-left' },
size: { width: 'fill', height: mm(BAND) } } },
line('journal', JOURNAL, HEI, 15, 'paper', onBand(15.8, 13),
{ fontWeight: 700, align: 'left', letterSpacing: pt(3) }),
line('issue', ISSUE, HEI, 8, 'mist', onBand(15.8, 16),
{ align: 'right' }),
line('title', '{titleText}', HEI, 17, 'ink', at('', 'top-left', 14),
{ fontWeight: 700, lineHeight: 1.45 }),
line('authors', '{attr.authors}', KAI, 12, 'ink', at('title', 'below', 4)),
line('affiliations', '{attr.affiliations}', SONG, 7.5, 'muted', at('authors', 'below', 2)),
] } };
题名区是一级标题的设计,所用标题样式跨两栏通排。色带是锚定在裁切边上的方框,刊名用白色压在上面。题名、作者和作者单位取自标题及其属性,每一项放在上一项之下(#title、below),题名排成三行时,下面各项会随之下移(通栏与高级设计)。
#4 · 摘要及其标签
// In 宋, not 楷: the one Kai on Fontsource is a Taiwan face (gotcha: cjk-face-region).
const calloutStyles = [{ id: 'abstract', span: 'page', backgroundEnabled: false,
padding: { top: pt(0), bottom: pt(0), left: em(2), right: em(2) },
marginTop: pt(0), marginBottom: pt(LEAD),
body: { fontFamily: SONG, fontSize: pt(BODY), lineHeight: pt(LEAD), firstLineIndent: pt(0),
textAlign: 'justify' } }];
const chipStyles = [{ id: 'label', fontFamily: HEI, bold: true, color: col('indigo'),
backgroundEnabled: false, borderWidth: pt(0), paddingX: em(0), gap: em(0.5) }];
摘要是一个通栏标注框,左右各缩进两个字。标签用行内标签排::chip[摘 要:]{style="label"}把这几个字排成黑体粗体,用刊物的靛蓝色,不加边框(行内标签样式)。中文期刊的摘要常用楷体,这里仍用宋体,原因见常见问题。
const palette = {
ink: '#1a1a1a', indigo: '#24427a', mist: '#b8c6e0', rule: '#9aa3b5', muted: '#5f6470',
paper: '#ffffff',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.indigo })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
完整食谱
// ═══ Postext Cookbook · Nº 090 · A Chinese paper cited to GB/T 7714 ═════════════════
// https://postext.dev/en/cookbook/gbt7714-chinese-paper
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Noto Serif SC, Noto Sans SC, LXGW WenKai TC (SIL OFL 1.1) · Needs postext ≥ 1.34.0
import {
buildDocument, withLoadedFonts, 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 frame; the paper is Chinese in both editions
const RECIPE = 'gbt7714-chinese-paper';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: black text, one indigo for the journal's name, its rules and its labels
const palette = {
ink: '#1a1a1a', indigo: '#24427a', mist: '#b8c6e0', rule: '#9aa3b5', muted: '#5f6470',
paper: '#ffffff',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.indigo })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const [SONG, HEI, KAI] = ['Noto Serif SC', 'Noto Sans SC', 'LXGW WenKai TC']; // 宋, 黑, 楷
const [BODY, LEAD] = [9, 15]; // pt: 小五 on a 15 pt line, the grid both columns share
const [CHARS, LINES] = [23, 40]; // characters to a column's line, lines to a column
const PT = 25.4 / 72; // mm in a point
const AREA = (2 * CHARS + 2) * BODY * PT; // mm: two columns and a 2-em gutter, 152.4
// #region answer: GB/T 7714 numbered: [1] in citation order, [2–4], 等 or et al. by language
// Register the engine once, before the first build. The GB/T 7714 numeric style writes
// superscript [n] in the order works are first cited, joins three or more in a row into a
// range and sets the list with its type codes: [M] book, [J] article, [D] thesis, [C]
// conference paper, [EB/OL] web page. Its CSL file holds a second layout for works whose
// language is English, with "et al." for 等: a Western entry takes "et al." and a Chinese
// one keeps 等, each chosen by the entry's `language`.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'china-national-standard-gb-t-7714-2015-numeric',
locale: 'zh-CN', // 等, 卷, 版 and the other terms of the list
bibliography: { fontSize: em(7.5 / BODY), lineHeight: pt(12), entrySpacing: pt(1.5),
labelWidth: em(1.7) }, // turnovers under the text, not past it: [1] and a space
};
// #endregion
// #region masthead: the journal's name on an indigo band, then title, authors, affiliations
const BAND = 30; // mm from the trim's top
const at = (id, edge, y) => ({ anchor: { to: id ? `#${id}` : 'container', edge },
组合好的script.js可以直接运行:把它粘贴到任何页面的模块脚本中,或在CodePen上打开这道食谱。 GitHub上的食谱文件夹 ↗ (在新标签页中打开)
变化
#序号排在行内
有些期刊把引文序号排在行内,与正文同字号。marker只改变序号的标注方式,不改动样式:'brackets'排出行内的[1],'corner'排出〔1〕。
locale: 'zh-CN', // 等, 卷, 版 and the other terms of the list
+ marker: 'brackets',#中文文献排在前面
中西文混排的文献表,有时把中文文献排在西文文献之前。顺序编码制这样排,表中序号就不再依次递增,所以更适合著者-出版年制。
- style: 'china-national-standard-gb-t-7714-2015-numeric',
+ style: 'china-national-standard-gb-t-7714-2015-author-date',
locale: 'zh-CN', // 等, 卷, 版 and the other terms of the list
- bibliography: { fontSize: em(7.5 / BODY), lineHeight: pt(12), entrySpacing: pt(1.5),
+ bibliography: { groupByLanguage: true, fontSize: em(7.5 / BODY), lineHeight: pt(12),常见问题
易错点
用zh-Hans或zh-Hant标记文档,不要用LANG
食谱的版本是en和es,但中文示例在两个版本里都是中文:`locale: LANG`会把它标记为英文或西班牙文,给其中的拉丁文词断词,把图标注为Figure或Figura,并给PDF标上错误的语言。postext 1.30起,这个标记也是文字成形所用的语言(测量、绘制和嵌入都按它进行),所以标记成英文或西班牙文时,中文字体的数字和与拉丁文共用的标点会换成另一套字形,断行的位置也随之改变。自己写出标记:'zh-Hans'(大陆规范:GB断行规则、开明式标点)或'zh-Hant'(台湾:全角居中标点);香港用'zh-HK'。单写'zh'按简体、大陆规范处理。日文示例写'ja'(见gotcha ja-locale-tag)。 中文断行 →
易错点
中文字体通过cjk块分片加载
Fontsource把一个中文、日文或韩文字体家族按每个字重约一百个文件提供,每个文件覆盖一段字符范围。loadFonts只获取latin文件,所以屏幕上的汉字来自系统字体,测量不准;fontsourceProvider交给PDF的也是这个latin文件,汉字印出来是空框。列出kit中的cjk块,在loadFonts之后调用loadCjkFonts(FONTS, markdown)(书中用到几种CJK字体时,每种字体调用一次,并传入它所排的文字),并给renderToPdf传fontProvider: cjkPdfProvider:两者都会取用包含文中字符的那些文件。 中日韩字体 →
- 叙述式引文,即不加方括号的
@zhou2019,会印出著者再加序号,但代号会一直延续到后面的汉字,@zhou2019认为就成了一个不存在的代号。把姓名写进正文,引文放在后面:周明远[@zhou2019]认为,中文论文本来也是这样写的。 - 随包的顺序编码制样式不印引文页码:
[@zhou2019, 页 45]只排出[5]。GB/T 7714要求把页码放在方括号外、同在上标里,即[5]45;在样式支持之前,请把页码写进句子。 - LXGW WenKai TC是Fontsource上唯一的楷体,属于台湾字形:它把“,”“。”画在字格正中,而在
zh-Hans下引擎会去掉字格的右半,正好切到标点。所以摘要用Noto Serif SC,楷体只用于作者姓名,那里没有标点。 - 在字格上,各栏齐底默认关闭:每一行都留在字格上,放不下下一个标题的栏就提前结束。不开启时,第1页右栏会空出三行(“2 结果”需要两行标题位置,下面还要跟两行正文,于是移到第2页开头),末页则排满左栏,右栏只排到一半。本例设了
headings.balancing.enabled: true:各栏齐底在标题上方补上整行字格来填满较短的栏,不会把字拉出各自的字格,末页的两栏也在同一行结束。
致谢
- 文本
- 原创文字, CC BY 4.0
- 字体
- Noto Serif SC (SIL OFL 1.1) · Noto Sans SC (SIL OFL 1.1) · LXGW WenKai TC (SIL OFL 1.1)


