Skip to main content
Recipe number 91

Cookbook · Chapter 5 · Book structure

Vertical Chinese with citations in inline notes

A vertical chapter in Traditional characters, bound on the right, whose GB/T 7714 note citations are set as 夾注 inside the column.

On this page
Output
Canvas · PDF
Postext
Tested with Postext 1.65.0
Needs ≥ 1.25.0 · postext-pdf ≥ 1.25.0
Licence
Updated 11 Oct 2026
Code MIT · Text CC BY 4.0

pp. 四十六–四十七 · 2–3 of 3

  • Trim 140 × 203 mm
  • 1 column
  • Noto Serif SC 10.5/19
  • LXGW WenKai TC
  • Noto Sans SC
  • 3 pages
  • Level
  • Postext 1.65.0
  • Laid out in 120 ms
  • 125 lines of code

In short

A chapter of a Chinese book set in columns from top to bottom. Each source is cited in a small two-line note inside the column, and the works cited are listed at the end.

What you'll build

The end of a chapter from an invented book on Chinese printing, 版刻叢談 (“Talks on block printing”), set in Traditional characters, top to bottom in columns read from the right, on a 大32開 page of 140 × 203 mm bound on the right. The chapter is about the layout of Song editions, and cites five real works. Each citation is set the way Chinese books have set commentary for centuries: as a 夾注, a note in two rows at half the text size, inside the column where the citation stands. A note that does not fit in what is left of a column goes on at the head of the next, and one goes on across the page turn. The notes follow the note form of GB/T 7714—2015, the mainland standard for references, and the chapter ends with a numbered list of the works it cites, the English ones turned sideways. The same chapter with its notes at the foot of the page would be set like Nº 071.

This recipe answers

  • How do I cite to the Chinese standard GB/T 7714, also in vertical text?
  • How do I set citations as footnotes, Chicago style, with short forms for later citations?

The short answer

script.js · lines 29–43in full code
// The GB/T 7714 note style turns each citation into a note. notes: 'warichu' sets the note
// in the column where the citation stands, in two rows at half the text size, the right
// row read first; a note longer than what is left of the column goes on in the next one.
// The list at the chapter's end comes from :::bibliography{scope=chapter}, numbered in
// the order the works are cited. Latin words turn sideways in the notes and in the list.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
  style: 'china-national-standard-gb-t-7714-2015-note',
  notes: 'warichu', // 夾注; 'footnote' sets the same notes at the foot of the page
  bibliography: { fontSize: em(0.9), entrySpacing: pt(0) },
};
const cjk = {
  grid: { enabled: true, charsPerLine: 36, linesPerPage: 15 },
  warichu: { fontSize: em(0.5), color: col('ink') }, // no brackets: the half size sets it off
};

A note style set as 夾注, two half-size rows inside the column

Ingredients

Type
Noto Serif SC, Noto Sans SC, LXGW WenKai TC (SIL OFL 1.1)
Assets
None: every picture is drawn in code

Method

#1 · A note style, set inside the line

The code is the short answer above. The GB/T 7714 note style (china-national-standard-gb-t-7714-2015-note) is a note style: each citation becomes a note that names the work in full (Citations). By default a note style sends its notes to the foot of the page. notes: 'warichu' keeps each note in the column instead, set as a warichu: two rows at cjk.warichu.fontSize, half the text size, centred on the column, the right row read first (Marks, ruby and warichu). The Markdown is the same as for any style, [@su1999] after the words it supports, and the note takes the place of the citation, before the 。 that ends the sentence.

Page 1: the note on 宿白’s book starts at the foot of the third column and goes on at the head of the fourth, the right row first each time.

The rows are filled part by part. At the foot of the third column there is room for 宿白. 唐宋時期 and no more, so it is split into two rows of three and four cells; the rest of the note fills the head of the next column, again in two rows. On page 2 Twitchett’s note begins at the foot of the last column, and the reader turns the page to finish it.

#2 · The works cited, at the end of the chapter

:::bibliography{title="本章引用書目" scope=chapter} sets the list where it stands and lists only the works this chapter cites (The bibliography). The references come from a BibTeX block. Each entry carries a langid, chinese or english, which the style reads as the work’s language, and names written in characters stay whole. The list is numbered in the order of first citation, and an entry’s turnover columns start below its label.

#3 · Traditional characters to mainland rules

locale: 'zh-Hant-CN' asks for Traditional characters set to the mainland’s rules, as publishers in Beijing and Shanghai set classical scholarship: the comma and the full stop sit in the top right corner of their cell, and a vertical book is bound on the right. The citations follow the tag: Traditional script picks the zh-TW CSL locale, so the words the style adds are in Traditional characters too. Noto Serif SC draws Traditional characters in the mainland’s forms, which suits this edition; LXGW WenKai TC, a Taiwan face, sets only the chapter title, which has no punctuation (Numbers in vertical text explains what happens to the digits).

In the notes and the list, a Latin title and a four-digit year turn sideways and run down the column. A short number next to Chinese text, such as the 1 of a label, stands upright in its cell.

#4 · The opener between rules

script.js · lines 47–64in full code
// In the flow frame x runs down the column and y across the page, right to left, so a
// 'horizontal' rule is a vertical line on the sheet: three of them rule the two columns.
const [TITLE, PITCH] = [15, 1.6 * LEAD]; // pt: the title's size and its column pitch
const rule = (n) => ({ kind: 'rule', id: `rule-${n}`, direction: 'horizontal',
  thickness: pt(n === 1 ? 0.4 : 0.8), color: col('vermilion'),
  placement: { anchor: { to: 'container', edge: 'top-left' },
    offset: { y: pt(LEAD + n * PITCH) }, size: { width: 'fill' } } });
// A line of PITCH in column n (0, 1), its characters centred between two rules.
const title = (id, content, n, family, size, weight) => ({ kind: 'text', id, content,
  fontFamily: family, fontWeight: weight, fontSize: pt(size), lineHeight: PITCH / size,
  color: col('ink'), letterSpacing: pt(size * 0.25), align: 'left',
  placement: { anchor: { to: 'container', edge: 'top-left' },
    offset: { x: pt(2 * BODY), y: pt(LEAD + n * PITCH) } } }); // two characters down
const opener = { enabled: true, minHeight: cols(5), slot: { elements: [
  rule(0), rule(1), rule(2),
  title('number', '{number}', 0, HEI, 12, 700), // 第三章 in the first column, in 黑
  title('title', '{titleText}', 1, KAI, TITLE, 400), // the title in the second, in 楷
] } };

On a vertical page a heading design is laid out in the flow frame: x runs down the column and y across the page from its right edge, so a 'horizontal' rule is a vertical line on the sheet. Three rules frame two columns 30.4 pt apart. 第三章 stands in the first in bold Hei, and the title in the second in Kai (Span and advanced design). The chapter number comes from startAt=3 on the heading and the template 第{1:一}章, and the folios from pageNumbering: trad-chinese-informal from 45. The running heads and folios go down the fore-edge as in Nº 075 (Vertical text elements).

script.js · lines 17–22in full code
const palette = {
  ink: '#22201c', vermilion: '#a8352a', muted: '#6d665d', paper: '#fbf8f1',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.vermilion })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));

The whole recipe

Sandbox
// ═══ Postext Cookbook · Nº 091 · Vertical Chinese with citations in inline notes ══════
// https://postext.dev/en/cookbook/vertical-book-with-jiazhu-citations
// 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.25.0
import {
  buildDocument, withLoadedFonts, renderPageToCanvas, registerCitationEngine,
  loadVerticalAlternates,
} 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 chapter is Chinese in both editions
const RECIPE = 'vertical-book-with-jiazhu-citations';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: black ink, one vermilion for the opener's rules, the paper of the page
const palette = {
  ink: '#22201c', vermilion: '#a8352a', muted: '#6d665d', paper: '#fbf8f1',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.vermilion })
  .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] = [10.5, 19]; // pt: 五號 on a column pitch of 1.8 em
const cols = (n) => pt(n * LEAD); // n columns across the page

// #region answer: a note style set as 夾注, two half-size rows inside the column
// The GB/T 7714 note style turns each citation into a note. notes: 'warichu' sets the note
// in the column where the citation stands, in two rows at half the text size, the right
// row read first; a note longer than what is left of the column goes on in the next one.
// The list at the chapter's end comes from :::bibliography{scope=chapter}, numbered in
// the order the works are cited. Latin words turn sideways in the notes and in the list.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
  style: 'china-national-standard-gb-t-7714-2015-note',
  notes: 'warichu', // 夾注; 'footnote' sets the same notes at the foot of the page
  bibliography: { fontSize: em(0.9), entrySpacing: pt(0) },
};
const cjk = {
  grid: { enabled: true, charsPerLine: 36, linesPerPage: 15 },
  warichu: { fontSize: em(0.5), color: col('ink') }, // no brackets: the half size sets it off
};
// #endregion

// #region opener: 第三章 and the title in two ruled columns, the text after a blank one
// In the flow frame x runs down the column and y across the page, right to left, so a
// 'horizontal' rule is a vertical line on the sheet: three of them rule the two columns.

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

#Brackets round each note

Some editions close a 夾注 in brackets at the text size. cjk.warichu sets them for every note, the citations included.

-  warichu: { fontSize: em(0.5), color: col('ink') }, // no brackets: the half size sets it off
+  warichu: { fontSize: em(0.5), color: col('ink'), open: '〔', close: '〕' },

#Numbers in the column instead of notes

The numeric GB/T 7714 style with corner brackets prints 〔1〕 upright in the column, and the list stays as it is.

-  style: 'china-national-standard-gb-t-7714-2015-note',
-  notes: 'warichu', // 夾注; 'footnote' sets the same notes at the foot of the page
+  style: 'china-national-standard-gb-t-7714-2015-numeric',
+  marker: 'corner', // 〔1〕, upright in vertical text

Pitfalls

Pitfall

Tag the document zh-Hans or zh-Hant, not with LANG

A recipe's editions are en and es, but a Chinese sample is Chinese in both: `locale: LANG` would tag it English or Spanish, hyphenate its Latin words, label its figures Figure or Figura and give the PDF the wrong language. From postext 1.30 the tag is also the language the text is shaped in (measured, painted and embedded), so under an English or Spanish tag a Chinese face sets its digits and the punctuation it shares with Latin text in other forms, and the lines break elsewhere. Write the tag yourself: 'zh-Hans' (mainland conventions: GB line breaking, Kaiming punctuation) or 'zh-Hant' (Taiwan: full-width centred punctuation); 'zh-HK' for Hong Kong. A bare 'zh' reads as Simplified, mainland. A Japanese sample takes 'ja' (gotcha ja-locale-tag). Chinese line breaking →

Pitfall

Chinese faces load by slices, through the cjk block

Fontsource serves a Chinese, Japanese or Korean family as about a hundred files per weight, each covering a range of characters. loadFonts fetches only the latin file, so on screen the Han characters come from a system face and measure wrong, and fontsourceProvider hands the PDF that latin file, which prints them as empty boxes. List the cjk kit block, call loadCjkFonts(FONTS, markdown) after loadFonts (once per voice, with the text it sets, when the book uses several CJK faces) and give renderToPdf fontProvider: cjkPdfProvider: both take the files that hold the text's characters. Chinese, Japanese and Korean fonts →

Pitfall

Set each region's punctuation in a face of that region

The punctuation widths move the blank beside each mark to the side the document's region puts it, not the side the font draws it: under zh-Hans a Kaiming comma keeps the left half of its box, where a Simplified face draws the glyph, and gives up the right half. A Traditional face centres ,。 in the box, so the half that goes holds part of the glyph and the comma crowds the next character. LXGW WenKai TC, the only Kai text face on Fontsource, does this in Simplified text. Set mainland text, notes and quotations in Noto Serif SC or Noto Sans SC, keep the TC faces for zh-Hant, and use a Simplified brush face (Ma Shan Zheng) only for display lines, where design text applies no punctuation widths. It also draws inherited forms that neither the mainland nor the Taiwan standard prints, 為 with the 爫 top of 爲 and 令 (in 冷, 領) with a 卩 foot: check the characters a page sets in it. Chinese punctuation widths →

Pitfall

A right-bound book shows its spreads with showBook

In a book bound on the right (Arabic, Hebrew or Persian text, vertical Chinese, or page.binding 'right') page 1 is still the recto, but it lies on the left of the spine, and the pairs read [3 | 2]. showPages lays every book out left-bound; showBook from the book block (the cjk block carries the same function) reads doc.binding and mirrors the pairs. capture.hero still names a spread in reading order, [verso, recto]: [2, 3]. Books bound on the right →

  • A note style writes a work cited a second time in short form, and the GB/T 7714 note style shortens it to 同1, “as in note 1”. A warichu has no number, so the reader cannot find note 1. This chapter cites each work once; a text that cites a work again should write the second citation by hand, or use the numeric style of the second variation.
  • The style writes Western punctuation into Chinese entries, 宿白. 唐宋時期的雕版印刷[M]. 北京: 文物出版社, 1999., as the standard prints them. In a vertical column those marks keep their Western form: they turn sideways and take less than a cell, unlike the 。 and , of the text.
  • A warichu row is half the text size: at 10.5 pt each row is 5.25 pt, the smallest type on the page. Set the text at 五號 or larger, or raise cjk.warichu.fontSize; the two rows always share one column’s width.

Credits

Text
Original prose, CC BY 4.0
Fonts
Noto Serif SC (SIL OFL 1.1) · Noto Sans SC (SIL OFL 1.1) · LXGW WenKai TC (SIL OFL 1.1)
SandboxPDF