Skip to main content
Recipe number 99

Cookbook · Chapter 5 · Book structure

A legal opinion cited in OSCOLA

A four-page case comment whose [@robinson2018, para 21] citations become OSCOLA footnotes: cases in italics, neutral citations, ibid and (n 1) cross-references.

On this page
Output
Canvas · PDF
Postext
Tested with Postext 1.65.0
Needs ≥ 1.65.0 · postext-pdf ≥ 1.65.0
Licence
Updated 31 Oct 2026
Code MIT · Text CC BY 4.0
  • Trim 162 × 240 mm
  • 1 column
  • Libre Baskerville 9.4/13.6
  • Libre Caslon Display
  • Libre Franklin
  • 4 pages
  • Level
  • Postext 1.65.0
  • Laid out in 200 ms
  • 163 lines of code

In short

A short commentary on an English court decision about the police. Every case, statute and article it relies on is cited in a numbered note at the foot of the page, in the style British law schools use.

What you'll build

An offprint from a law journal's case-comment series: four pages on Robinson v Chief Constable of West Yorkshire Police, the 2018 Supreme Court decision on when the police owe a duty of care. The page is 162 × 240 mm, mirrored, in Libre Baskerville at 9.4/13.6 pt, and the first page opens on a claret band with the case name set in 60 pt italics. The author writes each authority as a key with its pinpoint, [@caparo1990, 617–18], and Postext sets 23 footnotes in OSCOLA, the citation standard of British law schools: case names in italics, statutes in roman, no full stops after AC, HL or edn, ibid for the authority of the note before and Robinson (n 1) [55] after that. The authorities are real; the author and the journal are not.

This recipe answers

  • How do I cite cases and legislation in footnotes, in the OSCOLA style of British legal writing?
  • How do I set citations as footnotes, Chicago style, with short forms for later citations?

The short answer

script.js · lines 50–68in full code
// 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') },
};

OSCOLA footnotes for cases, statutes and articles

Ingredients

Type
Libre Baskerville, Libre Caslon Display, Libre Franklin (SIL OFL 1.1)
Assets
None: every picture is drawn in code

Method

#1 · An OSCOLA note for every authority

The code is the short answer above. OSCOLA is a note style, so [@robinson2018, para 21] leaves a superscript number after the full stop and its words go to the foot of the page. Note 1 gives the case in full, Robinson v Chief Constable of West Yorkshire Police [2018] UKSC 4, [2018] AC 736; note 2, which cites it again at once, reads ibid [21]; note 8, after other cases have come between, reads Robinson (n 1) [26–27]. A law-review article cites only in its notes, so bibliography.auto: false keeps the list of works off the last page.

#2 · A case is data, written as the reports print it

A case is a CSL item of type: legal_case: its name in title, the court in authority, the report series in container-title and the first page in page. OSCOLA puts the year of a report in square brackets when the year identifies the volume, as with the Appeal Cases, so the recipe writes that year in volume, with the volume number after it: volume: "[1990] 2" gives [1990] 2 AC 605 (HL). A case decided after 2001 also has a neutral citation: authority: UKSC, number: "4" and issued: 2018 give [2018] UKSC 4, followed by the report. A statute is type: legislation with the year in its title and no issued, so the year is not printed twice, and [@hra1998, § 6] cites a section as s 6.

#3 · Two patches to the bundled style

script.js · lines 32–46in full code
// 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"/>');

The bundled oscola.csl brackets a paragraph pinpoint only in a case's first note. Later notes printed para 55 and ibid 27, and a second note to the same Act lost its s. The patch replaces one macro and one line of the style's XML before the build and passes the result as a custom style, so the text and the references do not change.

#4 · The case name on the band

script.js · lines 72–96in full code
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) }),
  ] },
};

The band runs 124 mm down from the trim. The case name, the parties and the citation are heading attributes, so another comment in the series changes only its Markdown. Robinson is set in Libre Baskerville Italic at 60 pt because OSCOLA italicises case names, and the citation under it stays roman, as it does in the notes.

script.js · lines 16–23in full code
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' } }));

The whole recipe

Sandbox
// ═══ 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

The composed script.js runs as it is: paste it into any page’s module script, or open the recipe on CodePen. Recipe folder on GitHub ↗ (opens in a new tab)

Variations

To compare with the unpatched output, use the bundled id. Paragraph pinpoints in later notes then read para 55.

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

#Collect the notes at the end

Some journals print their notes after the text. The citations keep their full and short forms and their numbers.

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

Pitfalls

  • A report whose volume is a plain number, volume: "2", prints the year in round brackets, (1990) 2 AC, which OSCOLA keeps for series numbered across years such as the Commonwealth Law Reports (note 7). Write the bracketed year into volume for the Appeal Cases and the Weekly Law Reports.
  • s before a locator means a page (German Seite), not a section: write § 6. A subsection such as 6(1) is not read as a locator; name it in the sentence and cite the section.
  • OSCOLA has no bibliography in an article, and the style has no separate tables of cases and legislation. A thesis that needs those tables gets one sorted list from :::bibliography, with secondary sources first and then cases and statutes mixed.

Credits

Text
Original prose, CC BY 4.0
Fonts
Libre Baskerville (SIL OFL 1.1) · Libre Caslon Display (SIL OFL 1.1) · Libre Franklin (SIL OFL 1.1)
SandboxPDF