In short
Two pages of a Chinese newspaper from 1912, printed in columns that read from top to bottom. The page is cut into stacked bands with a line between them, the way old papers did it.
What you'll build
Two sheets of a Chinese newspaper as it looked in 1912, the first year of the Republic, when the papers were still set down the page. The text comes from the Shanghai Shenbao: Sun Yat-sen at a banquet on West Lake, where Chen Qimei stood up to object to a speech and stood up again to apologise; the memorial for the Zhejiang soldiers killed taking Nanjing; the victory monument Hangzhou raised for the returning army. Four telegrams from the first issue of the Provisional Government's gazette fill a box. The body runs in two tiers (欄) of 25 characters with a rule between them, the telegrams in three. A vermilion masthead and the lead headline, set down the full height of the page, open the front sheet. Newspaper front page builds the same page across.
This recipe answers
- How do I set a Chinese newspaper page vertically, in tiers with rules between them?
- How do I set a chapter title across the page while the body runs in two columns below?
- Can Postext set three or more text columns, or wrap text around an image?
- How do I set the type area in characters, so many to the line and so many lines to the page?
The short answer
// On a vertical page two columns are two tiers (欄), stacked and filled from the upper right:
// the gutter is the gap between them, the column rule a rule across the page.
const layout = {
layoutType: 'double', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'
gutterWidth: pt(2 * BODY),
columnRule: { enabled: true, color: col('ink'), lineWidth: pt(0.75) },
};
// The grid counts characters down a tier and lines across the page: 25 × 29.
const cjk = { grid: { enabled: true, charsPerLine: CHARS, linesPerPage: 29 } };
// The body stays in two tiers. The telegrams take three inside a page-span box floated to
// the foot of the flow, the left of the sheet, with the fences
// :::callout{type="wires" span="page" placement="bottom" title="電報"} and :::columns{count=3}
const wires = { id: 'wires', backgroundEnabled: false,
stripe: { enabled: true, side: 'top', width: pt(1.5), color: col('ink') }, // on its right
padding: { top: pt(6), right: pt(0), bottom: pt(0), left: pt(0) },
columnGap: pt((HEIGHT - 3 * 18 * 9) / 2), // three tiers of 18 characters of 9 pt
titleStyle: { fontFamily: HEI, fontSize: pt(12), fontWeight: 700, color: col('accent') },
body: { fontFamily: SONG, fontSize: pt(9), lineHeight: pt(13.5), textAlign: 'justify',
firstLineIndent: pt(0), boldFontWeight: 700 } };
Two tiers down the page with a rule between them, three inside a box
Ingredients
- Features
- One or two columnsColumn ruleDesigned openersVertical textBooks bound on the rightCharacter gridColumns in a box or in the textBoxes across the pageFloated boxesHeading stylesHeading attributesText, rules and boxes in page designsRunning heads and foliosHeads by page roleParagraph stylesChinese, Japanese and Korean fontsChinese punctuation widthsSemantic colour palettePDF exportFonts embedded in the PDF
- Type
- Noto Serif TC, Noto Sans TC, LXGW WenKai TC (SIL OFL 1.1)
- Assets
- None: every picture is drawn in code
Method
#1 · Turn two columns into two tiers
The code is the short answer above. With writingMode: 'vertical-rl' the page is a horizontal page turned a quarter turn, so layoutType: 'double' stacks two tiers, the upper one read first, and the column rule becomes a rule across the page between them (vertical writing). The character grid sets each tier to 25 characters of 五號 (10.5 pt), the long end of a newspaper column, and the page to 29 lines; it rounds the gutter to two ems and grows the margins so the tiers sit in the middle of them (character grid).
The body stays in two tiers and only the telegrams need three, so they go in a box: span="page" makes it as tall as the type area, placement="bottom" floats it to the foot of the flow, which on a vertical page is the left edge, and :::columns{count=3} cuts it into tiers. columnGap is what three tiers of 18 characters of 9 pt leave of the type area's 546 pt, so each tier holds whole characters.

#2 · Put the masthead and the lead headline in one design
// A page-span heading always opens a page (gotcha: page-span-heading-new-page), so the lead
// story's H1 carries the masthead in its own design, above its headline.
const MAST = 6.5 * LEAD; // the masthead's block, across the page
const block = (id, inset, style) => ({ kind: 'box', id, style,
placement: at(inset, inset, { size: { width: pt(HEIGHT - 2 * inset),
height: pt(MAST - 2 * inset) } }) });
const BAND = 13 * LEAD; // the whole design: masthead, headline, deck
const front = { enabled: true, minHeight: pt(BAND), slot: { elements: [
block('field', 0, { backgroundColor: col('accent') }), // the name reversed out of it
block('frame', 3.5, { borderColor: col('paper'), borderWidth: pt(0.75) }),
text('name', '{title}', KAI, 700, 64, 'paper', { lineHeight: 1, letterSpacing: pt(6),
placement: at(22, 13) }),
text('kicker', '{subtitle}', HEI, 700, 12, 'paper', { placement: at(24, 82) }),
text('sources', '錄{author}', HEI, 400, 8.5, 'paper', { placement: at(150, 84) }),
text('issue', '{attr.issue}', HEI, 700, 12, 'paper', { placement: at(330, 33) }), // the year
text('edition', '{attr.edition}', HEI, 400, 8.5, 'paper', { placement: at(330, 84) }),
text('sheet', '第{pageNumber}張', HEI, 700, 10, 'accent', { placement: at(HEIGHT - 58, 80),
box: { backgroundColor: col('paper'), padding: { top: pt(3), right: pt(3),
bottom: pt(3), left: pt(3) } } }),
// The headline down both tiers, centred; the dateline heads the deck's line.
text('head', '{titleText}', SONG, 900, 44, 'ink', { align: 'center', lineHeight: 1.1,
placement: at(0, MAST + 12, fill) }),
text('deck', '{attr.deck}', KAI, 400, 15, 'ink', { align: 'center',
placement: below('head', 6, fill) }),
text('dateline', '{attr.dateline}', HEI, 700, 9, 'muted', { placement: below('head', 10) }),
{ kind: 'rule', id: 'foot', direction: 'horizontal', thickness: pt(0.75),
color: col('ink'), placement: at(0, BAND - 3, fill) },
] } };
The lead story's headline had to cross both tiers under the masthead. A heading with span: 'page' is laid out as an opener at the head of a page, so a second one after the masthead would have started a page of its own. The H1 of the page is therefore the lead story, and its heading style draws the masthead above the headline: a vermilion block 6.5 lines deep with the paper's name reversed out and, under it, the issue line: the year of the Republic and of the cycle, and 今日出紙兩張, "two sheets today"; then the headline in Noto Serif TC 900 at 44 pt. In the flow the design's width is the height of the type area on the sheet, so size: { width: 'fill' } with align: 'center' centres the headline across both tiers. The design is 13 lines deep, a whole number of grid lines, so the text after it starts on a line of the grid.

#3 · Open each story with a heading design
const storyHead = { enabled: true, minHeight: pt(4 * LEAD), slot: { elements: [ // 4 lines
{ kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(0.5), color: col('rule'),
placement: at(0, 0, fill) },
text('head', '{titleText}', SONG, 900, 20, 'ink', { placement: at(0, 6) }),
text('deck', '{attr.deck}', KAI, 400, 11, 'ink', { // two characters down the tier
placement: below('head', 4, { offset: { x: pt(2 * BODY), y: pt(4) } }) }),
text('dateline', '{attr.dateline}', HEI, 700, 9, 'muted', { placement: below('deck', 4) }),
] } };
An in-column heading design lives inside its tier. Its rule is direction: 'horizontal' in the flow, so it runs down the tier on the sheet, a hairline between two stories. The headline starts at the head of the tier, the deck two characters lower, and the dateline gives the place, the paper and the day the report appeared. minHeight keeps each head four lines deep, so the text under every head starts on the grid.
#4 · Head the second sheet and sign it at the foot
// The header's frame is the margin above the tiers; the footer's, the margin below them.
const above = (y, extra = {}) => ({ anchor: { to: 'container', edge: 'top-left' },
offset: { x: pt(0), y: mm(HEAD - y) }, ...extra });
const header = { elements: [
text('title', '{title}', KAI, 700, 14, 'ink', { align: 'right', placement: above(13, fill) }),
text('sheet', '第{pageNumber}張', HEI, 700, 9, 'ink', { placement: above(10.8) }),
{ kind: 'rule', id: 'rule', thickness: pt(1.5), color: col('ink'), placement: above(6, fill) },
].map((element) => ({ ...element, pages: 'body' })) }; // page 1 has the masthead instead
const footer = { elements: [text('colophon', '{attr.colophon}', HEI, 400, 7, 'muted', {
pages: 'body', placement: at(0, 17, fill) })] }; // 6 mm under the tiers
Running heads stay horizontal on a vertical page, as clreq describes. The header's frame is the margin above the tiers; the grid grows that margin, and HEAD repeats the grid's sum so the rule sits 6 mm above the first character. pages: 'body' leaves page 1 to the masthead. The colophon is an attribute of the H1, so the English and Spanish editions each print their own line under the same Chinese pages.
#5 · Load each voice with the text it sets
const pick = (pattern) => (markdown.match(pattern) ?? []).join('');
const attrs = (...keys) => pick(new RegExp(`[{ ](?:${keys.join('|')})="[^"]*"`, 'g'));
const voices = [ // family, weights, the text it sets, and whether it runs down a column
[SONG, ['400'], markdown, true], // the text
[SONG, ['700', '900'], pick(/^#+ [^{\n]*|\*\*[^*]+\*\*/gm), false], // heads, labels
[HEI, ['400', '700'], pick(/^(?:subtitle|author): .*$|style="source"\}[^:]*/gm) // masthead,
+ attrs('dateline', 'issue', 'edition', 'title', 'colophon') + '錄第一二張', true], // datelines
[KAI, ['400'], attrs('deck') + pick(/style="inscription"\}[^:]*/g), true], // decks, the stele
[KAI, ['700'], pick(/^title: .*$/m), false], // the paper's name
];
Fontsource serves each weight of these faces as about a hundred files, and loadCjkFonts fetches the ones a text touches. Noto Serif TC 400 gets the whole sample; its 700 and 900 get only the headlines and the telegrams' labels, Noto Sans TC the masthead lines, datelines and colophon, and LXGW WenKai TC the decks, the inscription and the paper's name. A face given too little text fails the capture (C12) and names the characters it borrowed from another face.
The whole recipe
// ═══ Postext Cookbook · Nº 084 · A vertical newspaper page in tiers ═══════════════
// https://postext.dev/en/cookbook/vertical-newspaper-tiers
// Code: MIT · Text: Shenbao, 1912 (PD); gazette, stele report: zh.wikisource (CC BY-SA 4.0)
// Fonts: Noto Serif TC, Noto Sans TC, LXGW WenKai TC (SIL OFL 1.1) · Needs postext ≥ 1.46.2
import {
buildDocument, withLoadedFonts, renderPageToCanvas, loadVerticalAlternates,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the colophon; the news is Chinese in both editions
const RECIPE = 'vertical-newspaper-tiers';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: newsprint, ink and the vermilion of the masthead
const palette = {
ink: '#1c1a17', // text, the rules between tiers
accent: '#b0281c', // the one accent: the masthead block, the telegrams' flag
rule: '#8f887c', // the hairline before each story
muted: '#5e574e', // datelines, sources, the colophon
paper: '#f7f2e6', // newsprint, and the masthead's type reversed out of the vermilion
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
{ id: 'main-color', name: 'ink (defaults)', value: { hex: palette.ink, model: 'hex' } },
];
// #endregion
const [SONG, HEI, KAI] = ['Noto Serif TC', 'Noto Sans TC', 'LXGW WenKai TC']; // 宋, 黑, 楷
const BODY = 10.5; // pt: 五號, the body size of the papers of 1912
const LEAD = 15.75; // pt: the line pitch across the page, 1.5 em
const CHARS = 25; // characters down a tier: a newspaper column, 17 to 25
const HEIGHT = 2 * CHARS * BODY + 2 * BODY; // pt: two tiers and a gutter of two ems
const TRIM = { w: 184, h: 260 }; // mm, 16開
const MARGIN = { top: 30, bottom: 22, side: 11 }; // mm, minimums: the grid centres the tiers
// The grid grows the margins evenly, so the tiers start HEAD mm below the top edge.
const HEAD = MARGIN.top + (TRIM.h - MARGIN.top - MARGIN.bottom - (HEIGHT * 25.4) / 72) / 2;
// #region answer: two tiers down the page with a rule between them, three inside a box
// On a vertical page two columns are two tiers (欄), stacked and filled from the upper right:
// the gutter is the gap between them, the column rule a rule across the page.
const layout = {
layoutType: 'double', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'
gutterWidth: pt(2 * BODY),
columnRule: { enabled: true, color: col('ink'), lineWidth: pt(0.75) },
};
// The grid counts characters down a tier and lines across the page: 25 × 29.
const cjk = { grid: { enabled: true, charsPerLine: CHARS, linesPerPage: 29 } };
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
#Give the telegrams four tiers
Four tiers of 14 characters fit the same height, and the box narrows to the lines they need.
- columnGap: pt((HEIGHT - 3 * 18 * 9) / 2), // three tiers of 18 characters of 9 pt
+ columnGap: pt((HEIGHT - 4 * 14 * 9) / 3), // four tiers of 14 characters of 9 ptIn the Markdown, :::columns{count=4}.
#Set the stories in a single tier
One tier of 52 characters runs the height of the type area, 193 mm down the sheet for every line. Each story head now takes four lines of the whole page, and the two sheets become three.
- layoutType: 'double', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'
+ layoutType: 'single', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'With charsPerLine: 2 * CHARS + 2 in the grid.
Pitfalls
Pitfall
A page-span heading always opens a new page
A heading whose level or style sets span: 'page' is laid out as an opener at the head of a page, whether or not it has a breakBefore. Placed after other text, or after another opener on the same page, it moves to the next page and leaves the rest of the current one empty. A banner headline across both columns (or both tiers of a vertical page) under a masthead goes into the opener's own design, next to the masthead, or into a :::callout{span="page"} box as a heading without span, as newspaper-front-page sets its banners. Designed openers →
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
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
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 →
- Fontsource's Noto Serif TC declares 爲, the form the Shenbao printed, in the range of one of its files, but that file has no glyph for it: the canvas drew it in a system face and the PDF had none (C25). The reports set 為.
- The Wikisource transcriptions have slips the page corrects: 己紀 for 已紀 and, twice, 倍侍 for 陪侍 in the banquet report; in the memorial report 勸勵一番現在將土, with 土 for 士 and the object after 一番, set here as 勸勵現在將士一番, "encouraged the officers and men present". The page also sets the standard form of four variants: 寧 for 寗, 總 for 縂 (three times) and 決 for 决 (twice) in the telegrams, 刊 for 刋 in the inscription.
- LXGW WenKai TC, as Fontsource serves it, draws 為 as 爲, so the inscription, in Kai, shows the older form the Song text lacks.
- The three tiers of the box are thirds of the type area and do not line up with the two tiers of the body. A newspaper sets such a section to its own grid; the rule on the box's right edge keeps the two grids apart.
Credits
- Recipe
- Ignacio Ferro
- Text
- Shenbao (Shanghai), 11 December 1912: the banquet for Sun Yat-sen at West Lake, Hangzhou · Shenbao; transcription by Wikisource editors · public domain
- Shenbao (Shanghai), 4 December 1912: the memorial for the Zhejiang soldiers killed at Nanjing · Shenbao; transcription by Wikisource editors · public domain
- Shenbao (Shanghai), 17 July 1912: the victory monument at West Lake, with Tang Shouqian's inscription · Shenbao, Tang Shouqian; transcription and punctuation by Wikisource editors, revised for this recipe · CC BY-SA 4.0
- Four telegrams from Linshi zhengfu gongbao (Provisional Government Gazette) no. 1, 29 January 1912 · Provisional Government, Nanjing; transcription and punctuation by Wikisource editors · CC BY-SA 4.0
- Punctuation of the first two reports, the masthead, decks and datelines · Postext Cookbook · CC BY 4.0
- Fonts
- Noto Serif TC (SIL OFL 1.1) · Noto Sans TC (SIL OFL 1.1) · LXGW WenKai TC (SIL OFL 1.1)
Edit this write-up ↗ (opens in a new tab)Recipe folder on GitHub ↗ (opens in a new tab)


