跳到主要内容
食谱编号99

排版食谱 · 第5章 · 图书结构

用OSCOLA格式引注的法律评论

一篇四页的判例评论:正文写[@robinson2018, para 21],引文按OSCOLA排成脚注,判例名用斜体,带中立引注、ibid和(n 1)回指。

本页内容
输出
Canvas · PDF
难度
中级
Postext
已用Postext 1.65.0测试
需要≥ 1.65.0 · postext-pdf ≥ 1.65.0
许可证
更新于2026年10月31日
代码MIT · 文本CC BY 4.0
  • 英文样例:尚无中文版本
  • 成品尺寸162 × 240 mm
  • 1栏
  • Libre Baskerville 9.4/13.6
  • Libre Caslon Display
  • Libre Franklin
  • 4页
  • 难度
  • Postext 1.65.0
  • 排版用时200 ms
  • 163行代码

简单来说

一篇评论英国警察案件判决的短文。文中依据的每个判例、法规和文章都在页脚的编号注释中注明,用的是英国法学院通行的格式。

成品一览

一份法学期刊判例评论栏目的抽印本:四页,评论英国最高法院2018年的Robinson v Chief Constable of West Yorkshire Police案,讨论警察何时负有注意义务。页面162 × 240 mm,左右镜像,正文Libre Baskerville 9.4/13.6 pt,首页是一条酒红色色带,案名用60 pt斜体。作者把每个出处写成带定位的代号[@caparo1990, 617–18],Postext按英国法学院通行的OSCOLA格式排出23条脚注:判例名斜体,法规正体,AC、HL、edn等缩写后不加句点,紧接上一条注的同一出处写ibid,隔开之后写Robinson (n 1) [55]。所引判例和法规都是真实的,作者和期刊是虚构的。

这道食谱解答

  • 怎样按英国法律写作的OSCOLA样式在脚注中引用判例和法规?
  • 怎样按芝加哥注释体把引用排成脚注,并让后续引用用简略形式?

简短回答

script.js · 第50–68行在完整代码中
// The text cites with [@robinson2018, para 21]; OSCOLA is a note style, so each citation
// becomes a footnote: the case in full the first time, "ibid" when the note before cites
// the same authority, "Robinson (n 1) [55]" after that. Case names come out italic,
// statutes roman, and no abbreviation takes a full stop (AC, HL, UKSC, edn, n, s).
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
  style: 'custom', customStyle: OSCOLA, // the bundled 'oscola', patched above
  locale: 'en-GB', // OSCOLA's words stay English in the Spanish edition too
  notes: 'footnote',
  link: false, // a case comment has no bibliography to link to
  bibliography: { auto: false }, // OSCOLA articles cite in the notes only
};
// The citation notes share the numbering and the look of the author's own [^notes].
const footnotes = {
  placement: 'column', numbering: 'chapter',
  fontSize: pt(7.8), lineHeight: pt(10.2), spaceBetween: pt(2.2),
  textAlign: 'left', // ragged: long report citations would open wide gaps if justified
  separator: { width: 0.25, lineWidth: pt(0.5), color: col('rule') },
};

用料

类型
Libre Baskerville, Libre Caslon Display, Libre Franklin(SIL OFL 1.1)
素材
无:所有图片都用代码绘制

做法

#1 · 每个出处一条OSCOLA注

代码就是上面的简短回答。OSCOLA是注释体样式:[@robinson2018, para 21]在句号后留下一个上标数字,内容进入页脚。注1给出完整引注Robinson v Chief Constable of West Yorkshire Police [2018] UKSC 4, [2018] AC 736;紧接着再次引用的注2是ibid [21];中间隔了其他判例的注8是Robinson (n 1) [26–27]。法学期刊文章只在注释中引用,所以bibliography.auto: false不在末页排参考文献表。

#2 · 判例是数据,照判例汇编的写法录入

判例是type: legal_case的CSL条目:案名放title,法院放authority,汇编名放container-title,起始页放page。当年份用来确定卷册时(如Appeal Cases),OSCOLA把汇编年份放在方括号里,所以本例把这个年份连同卷号写进volume:volume: "[1990] 2"得到*[1990] 2 AC 605 (HL)。2001年以后的判决还有中立引注:authority: UKSC、number: "4"和issued: 2018得到[2018] UKSC 4*,后面再接汇编引注。法规是type: legislation,年份写在标题里、不设issued,免得年份印两次;[@hra1998, § 6]引作s 6。

#3 · 给内置样式打两个补丁

script.js · 第32–46行在完整代码中
// The bundled oscola.csl writes a paragraph pinpoint in brackets only in a case's first
// note: a later note printed "Robinson (n 1) para 55" and "ibid 27", and a repeated
// statute "ibid 7". These two replacements give "Robinson (n 1) [55]", "ibid [27]" and
// "ibid s 7", as OSCOLA prints them.
const LOCATOR = `<macro name="label-locator"><choose>
  <if type="legal_case" locator="paragraph">
    <text variable="locator" prefix="[" suffix="]"/></if>
  <else-if locator="page"><text variable="locator"/></else-if>
  <else><group delimiter=" "><label form="short" strip-periods="true" variable="locator"/>
    <text variable="locator"/></group></else>
</choose></macro>`;
const OSCOLA = STYLES.oscola
  .replace(/<macro name="label-locator">[\s\S]*?<\/macro>/, LOCATOR)
  .replace(/(<if position="ibid-with-locator">[\s\S]*?)<text variable="locator"\/>/,
    '$1<text macro="label-locator"/>');

内置的oscola.csl只在判例的第一条注里给段落定位加方括号,之后的注印成para 55和ibid 27,再次引用同一法规时也丢了s。补丁在排版前替换样式XML中的一个宏和一行,再作为自定义样式传入,正文和文献数据都不用改。

#4 · 色带上的案名

script.js · 第72–96行在完整代码中
const BAND = 124; // mm from the trim's top
const big = (id, content, family, size, color, y, extra = {}) => ({
  kind: 'text', id, content, fontFamily: family, fontSize: pt(size), lineHeight: 1.08, color,
  align: 'left', overflow: 'wrap', ...extra,
  placement: { ...at('container', 'top-left', 0, y), size: { width: mm(118), height: 'auto' } },
});
const opener = {
  enabled: true,
  minHeight: mm(BAND - MARGIN.top + 8), // the text starts 8 mm under the band
  slot: { elements: [
    { kind: 'box', id: 'band', style: { backgroundColor: col('claret') },
      placement: { ...at('page', 'top-left'), size: { width: 'fill', height: mm(BAND) } } },
    big('kicker', '{attr.kicker}', LABEL, 7.4, col('tint'), 2,
      { fontWeight: 600, letterSpacing: pt(1.4), textTransform: 'uppercase' }),
    big('case', '{attr.case}', TEXT, 60, col('paper'), 9, { italic: true }),
    big('parties', '{attr.parties}', TEXT, 12.5, col('tint'), 33, { italic: true }),
    big('citation', '{attr.citation}', TEXT, 10.5, col('tint'), 40),
    { kind: 'box', id: 'hairline', style: { backgroundColor: col('tint') },
      placement: { ...at('container', 'top-left', 0, 51),
        size: { width: mm(30), height: pt(0.6) } } },
    big('title', '{titleText}', DISPLAY, 27, col('paper'), 57),
    big('byline', '{attr.byline}', LABEL, 8.5, col('tint'), 82,
      { fontWeight: 500, letterSpacing: pt(0.5) }),
  ] },
};

色带从裁切边向下124 mm。案名、当事人和引注都是标题属性,同一栏目的另一篇评论只需改Markdown。Robinson用60 pt的Libre Baskerville斜体,因为OSCOLA要求案名斜体;下面的引注保持正体,与注释中一致。

script.js · 第16–23行在完整代码中
const palette = {
  ink: '#1f1b1a', claret: '#5e1b26', tint: '#ecdcd8', rule: '#bfb4ad', muted: '#6b625d',
  paper: '#fcfaf6',
};
// Each colour carries its hex and the palette entry it follows.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.claret })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));

完整食谱

沙盒
// ═══ Postext Cookbook · Nº 099 · A legal opinion cited in OSCOLA ══════════════════
// https://postext.dev/en/cookbook/legal-opinion-oscola
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Libre Baskerville, Libre Caslon Display, Libre Franklin (OFL 1.1) · Needs postext ≥ 1.65.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 = 'legal-opinion-oscola';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a law-report claret for the band, ink and cream paper for the rest
const palette = {
  ink: '#1f1b1a', claret: '#5e1b26', tint: '#ecdcd8', rule: '#bfb4ad', muted: '#6b625d',
  paper: '#fcfaf6',
};
// Each colour carries its hex and the palette entry it follows.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.claret })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const TEXT = 'Libre Baskerville', DISPLAY = 'Libre Caslon Display', LABEL = 'Libre Franklin';
const TRIM = { width: 162, height: 240 }; // a law-journal offprint
const MARGIN = { top: 23, bottom: 22, inner: 19, outer: 21 };
const LEAD = 13.6; // pt
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });

// #region oscola: two patches to the bundled OSCOLA style, applied before the build
// The bundled oscola.csl writes a paragraph pinpoint in brackets only in a case's first
// note: a later note printed "Robinson (n 1) para 55" and "ibid 27", and a repeated
// statute "ibid 7". These two replacements give "Robinson (n 1) [55]", "ibid [27]" and
// "ibid s 7", as OSCOLA prints them.
const LOCATOR = `<macro name="label-locator"><choose>
  <if type="legal_case" locator="paragraph">
    <text variable="locator" prefix="[" suffix="]"/></if>
  <else-if locator="page"><text variable="locator"/></else-if>
  <else><group delimiter=" "><label form="short" strip-periods="true" variable="locator"/>
    <text variable="locator"/></group></else>
</choose></macro>`;
const OSCOLA = STYLES.oscola
  .replace(/<macro name="label-locator">[\s\S]*?<\/macro>/, LOCATOR)
  .replace(/(<if position="ibid-with-locator">[\s\S]*?)<text variable="locator"\/>/,
    '$1<text macro="label-locator"/>');
// #endregion

组合好的script.js可以直接运行:把它粘贴到任何页面的模块脚本中,或在CodePen上打开这道食谱。 GitHub上的食谱文件夹 ↗ (在新标签页中打开)

变化

#使用未修改的样式

要与未打补丁的结果对比,改用内置样式名。之后各注中的段落定位会印成para 55。

-  style: 'custom', customStyle: OSCOLA, // the bundled 'oscola', patched above
+  style: 'oscola',

#把注释放到文末

有些期刊把注释集中在正文之后。引文保留完整和简略两种形式以及编号。

-  placement: 'column', numbering: 'chapter',
+  placement: 'chapterEnd', numbering: 'chapter',

常见问题

  • 卷号只写数字(volume: "2")时,年份印在圆括号里,成为*(1990) 2 AC*;OSCOLA只对跨年连续编卷的汇编这样写,如注7中的Commonwealth Law Reports。Appeal Cases和Weekly Law Reports要把方括号年份写进volume。
  • 定位前的s表示页(德语Seite),不表示条:请写§ 6。6(1)这样的款项不会被识别为定位,请在句中写明,引注只引到条。
  • OSCOLA的期刊文章不附参考文献表,样式也不区分判例表和法规表。需要这些表的论文用:::bibliography只能得到一份排序列表:先列学术文献,判例和法规混排在后。

致谢

文本
原创文字, CC BY 4.0
字体
Libre Baskerville (SIL OFL 1.1) · Libre Caslon Display (SIL OFL 1.1) · Libre Franklin (SIL OFL 1.1)
沙盒PDF