跳到主要内容
食谱编号133

排版食谱 · 第1章 · 页面与网格

六栏对开大报

一份日报在对开大报版面上的四个版:六栏加栏线,照片和框横跨其中两到五栏,通栏广告,评论版改为五栏。

本页内容
  • 英文样例:尚无中文版本
  • 成品尺寸375 × 597 mm
  • 6栏, 栏间距4 mm
  • Newsreader 9/12.2
  • Archivo Narrow
  • Playfair Display
  • 4页
  • 难度
  • Postext 1.65.0
  • 排版用时140 ms
  • 247行代码

简单来说

一份大开本日报的四个版,排成六个窄栏。示例演示怎样让照片或框横跨几栏,以及怎样让某一版改成五栏。

成品一览

虚构日报《The Corrington Despatch》的四个版,开本为375 × 597 mm的对开大报。正文分六栏,每栏55.2 mm,栏间距4 mm,每条栏间距里一条细栏线:9 pt字号下每行约38个字符,正是真实大报的行长。头版有带两个报眼的报头、一条导读条、标题和照片都横跨四栏的头条、配两栏照片的第二条新闻、一栏简讯、一张资金表和一个两栏宽的资料框,页脚是一则广告。第2版以头版的转版开头,第3版改为五栏,排社论、一篇评论和读者来信,末版是剧评和天气。

这道食谱解答

  • 报纸版面怎么排:对开报纸分五栏,一张照片横跨两栏,一个新闻框横跨三栏?
  • Postext能排三栏或更多栏,或者让文字绕图排吗?

简短回答

script.js · 第69–85行在完整代码中
const layout = { layoutType: 'multiple', columnCount: 6, gutterWidth: mm(GUTTER),
  columnRule: { enabled: true, color: col('rule'), lineWidth: pt(0.4) } };
// A float across k columns takes the head of the first run of k empty columns that start
// level, counted left to right from the column the text is in, or the foot of that column
// and the empty ones after it. So the order of the fences places them:
//   :::callout{type="head" placement="top" columns="4"}  ← columns 1–4, the text not begun
//   ::resource{id="quays"}                              ← columns 1–4 again, under the box
//   …the lead runs in columns 1–4…
//   :::callout{type="head" placement="top" columns="2"}  ← columns 5–6: 1–4 hold text now
const photo = (id, file, [w, h], columns, extra) => ({ id, typeId: 'photo', kind: 'bitmap',
  createdAt: 0, updatedAt: 0, bitmap: { fileId: file, format: 'jpeg', width: w, height: h },
  placement: { position: 'top', span: 'column', columns },
  note: 'Photograph: Despatch picture desk', ...extra });
// A table across two columns, at the foot of the column that cites it and the next one.
const panel = (id, model, extra) => ({ id, typeId: 'panel', kind: 'table', createdAt: 0,
  updatedAt: 0, table: { model }, placement: { position: 'bottom', columns: 2 }, ...extra });
// As many columns as the page has (or more) is page-wide: columns: 6 = span: 'page'.

用料

类型
Newsreader, Playfair Display, Archivo Narrow(SIL OFL 1.1)
素材
  • barrier-1152.jpg
  • baths-1536x768.jpg
  • quays-1440.jpg
  • stage-1800.jpg
  • terrace-1440.jpg
  • The Eastern Quays at sunrise (the front-page lead photograph) (Generated With Diffusion Models, CC BY 4.0)
  • Engineers watching a river flood gate (front page, second story) (Generated With Diffusion Models, CC BY 4.0)
  • A terraced street on moving day (page 2) (Generated With Diffusion Models, CC BY 4.0)
  • A Victorian swimming baths on a weekday morning (page 3) (Generated With Diffusion Models, CC BY 4.0)
  • A period drama on a theatre stage (page 4) (Generated With Diffusion Models, CC BY 4.0)

做法

#1 · 对开大报上的六栏

这一步的代码就是上面的简短回答。page.sizePreset: 'broadsheet'设定375 × 597 mm的开本,layoutType: 'multiple'加columnCount: 6把351 mm宽的版心切成六个等宽的栏(版式类型)。每栏宽(351 − 5 × 4) / 6 = 55.2 mm,9 pt的Newsreader每行约38个字符,所以正文需要断词,用minWordSpacing: 0.8防止词距收得过紧,用maxJustifyTracking: 15把松散行的空隙分摊到字母之间。栏线在每条栏间距里画一条0.4 pt的细线,遇到横跨的浮动体或框就断开。postext 1.17及以前,正文最多两栏,所以第027号只能把四栏简讯放进一个框里。

#2 · 跨k栏的浮动体占用第一组空栏

script.js · 第257–286行在完整代码中
const resources = [
  photo('quays', 'quays-1440.jpg', [1440, 1080], 4, {
    altText: 'A cobbled harbour quay at sunrise, with old rail tracks, three dockside cranes '
      + 'and brick warehouses beside calm water.',
    caption: '**The end of the line.** The Eastern Quays at sunrise. The trams will run on '
      + 'the old dock railway’s route past the bonded warehouses.' }),
  photo('barrier', 'barrier-1152.jpg', [1152, 1152], 2, {
    altText: 'Three engineers in orange jackets watch a steel flood gate hold back a high '
      + 'tide between two concrete towers.',
    caption: '**Holding.** Engineers watch the gate at 6.40 yesterday morning.' }),
  photo('terrace', 'terrace-1440.jpg', [1440, 1080], 4, {
    altText: 'A woman carries a box up the steps of a red-brick terraced house on an '
      + 'autumn street.',
    caption: '**Moving day** on Albion Terrace, where a two-bedroom flat now lets for £1,240.' }),
  photo('baths', 'baths-1536x768.jpg', [1536, 768], 3, {
    altText: 'A long Victorian swimming pool under an iron and glass roof, with one woman '
      + 'swimming and wooden cubicles along both sides.',
    caption: '**Forty lengths.** The Albert Baths, opened in 1894, on a weekday morning.' }),
  photo('stage', 'stage-1800.jpg', [1800, 1350], 5, {
    altText: 'Three actors in 1920s costume in a shipping office set on a theatre stage.',
    caption: '**Ledgers and lies.** The shipping office of *The Tally Clerk*.',
    note: 'Photograph: Corrington Playhouse' }),
  panel('funding', funding, { caption: '**Paying for the line**',
    note: 'Source: Corrington City Council, cabinet report, October 2026.' }),
  { ...panel('forecast', forecast(), { placement: { position: 'here' },
    caption: '**The next five days in Corrington**',
    note: 'High water at Salter’s Cut, Arle gate. Forecast: Despatch weather desk.' }) },
  ...Object.keys(SKY).map((id) => ({ id, typeId: 'photo', kind: 'svg', createdAt: 0,
    updatedAt: 0, svg: { fileId: `${id}.svg`, width: 240, height: 120 }, altText: id.slice(4) })),
];

placement.columns以栏数给出照片或表格的宽度,包括其间的栏间距:头版的四栏是232.7 mm。引擎从正文所在的栏开始,从左往右找位置。top浮动体占用第一组还没有正文、顶边齐平的k个栏的栏头;bottom浮动体占用正文所在栏及其后各空栏的栏脚。所以资金表在第3栏的段落里被引用,就落在第3、4栏底部。在第2版,资料框先开,占了第1、2栏,第3至6栏便成为后面那张四栏照片的第一组齐平空栏。顺序反过来,框就会叠在照片下面。k等于或大于本页栏数时就是通栏,与span: 'page'相同。

#3 · 标题框、资料框和广告

script.js · 第89–119行在完整代码中
const NO_PAD = { top: pt(0), right: pt(0), bottom: pt(0), left: pt(0) };
const head = { id: 'head', backgroundEnabled: false, padding: NO_PAD, // a headline and its deck
  titleStyle: { ...caps(8.5, 700, 'accent'), gap: mm(1.5) }, // the kicker: the fence's title
  marginBottom: pt(LEAD), keepTogether: true,
  body: { fontFamily: 'Newsreader', fontSize: pt(13), lineHeight: pt(16.5), italic: true,
    textAlign: 'left', firstLineIndent: pt(0) } };
const jump = { ...head, id: 'jump', marginTop: pt(LEAD), // a page-wide head under a 1 pt rule
  stripe: { enabled: true, side: 'top', width: pt(1), color: col('ink') },
  padding: { ...NO_PAD, top: mm(2.5) } };
const facts = { id: 'facts', background: col('tint'), keepTogether: true,
  stripe: { enabled: true, side: 'top', width: pt(2.5), color: col('accent') },
  padding: { top: mm(2.5), right: mm(3), bottom: mm(3), left: mm(3) },
  titleStyle: { ...caps(8.5, 700, 'accent'), gap: mm(1.5) }, marginBottom: pt(LEAD),
  body: { fontFamily: 'Archivo Narrow', fontSize: pt(9), lineHeight: pt(11.5),
    textAlign: 'left', firstLineIndent: pt(0), paragraphSpacing: true } };
const weather = { ...facts, id: 'weather', keepTogether: true,
  padding: { top: mm(3), right: mm(4), bottom: mm(4), left: mm(4) },
  body: { ...facts.body, fontFamily: 'Newsreader', fontSize: pt(10.5), lineHeight: pt(14) } };
const ad = { id: 'ad', backgroundEnabled: false, keepTogether: true,
  border: { enabled: true, color: col('ink'), width: pt(0.75) },
  padding: { top: mm(5), right: mm(6), bottom: mm(5), left: mm(6) },
  titleStyle: { ...caps(7, 600, 'muted'), gap: mm(3) }, // "Advertisement"
  body: { fontFamily: 'Archivo Narrow', fontSize: pt(13), lineHeight: pt(17),
    textAlign: 'left', firstLineIndent: pt(0), paragraphSpacing: true } };
const sky = { id: 'sky', background: col('tint'), columnGap: mm(GUTTER), // the teaser strip
  padding: { top: mm(2.5), right: mm(3), bottom: mm(2.5), left: mm(3) }, marginBottom: pt(LEAD),
  body: { fontFamily: 'Archivo Narrow', fontSize: pt(9.5), lineHeight: pt(12),
    textAlign: 'left', firstLineIndent: pt(0) } };
const headline = (id, size, look = {}) => ({ id, fontFamily: 'Playfair Display', fontWeight: 700,
  fontSize: pt(size), lineHeight: pt(size * 1.06), marginTop: pt(0),
  marginBottom: pt(size * 0.22), ...look });

带placement="top"和columns="4"的:::callout像照片一样浮动在四栏上。头条的标题和导语就是这样一个框,放在正文之前,所以占第1至4栏,照片叠在它下面。第二条新闻的标题框放在头条之后、一个:::columnbreak后面:这时正文已在第5栏,第5、6栏是第一对空栏。每则广告都是columns="6"的通栏框,在本版开头就开出,使其底部在正文到来之前就预留好;第2版和第4版的转版标题是通页宽的框,与第027号相同。balancing.trailing: false让每一版都把各栏填到底,因为这里每一版都结束一个栏目。fillShortColumns: true让因孤行规则而短了一行的栏,从它自己的段落里补上一行:第4版评论的第三栏因此与其他栏齐平。

#4 · 报头是头版的H1

script.js · 第45–65行在完整代码中
const ear = (side, lines) => lines.map(([id, content, look], i) => text(id, content,
  { ...look, align: side }, { ...(i === 0 ? at('container', `top-${side}`, 0, 4)
    : at(`#${lines[i - 1][0]}`, 'below', 0, 0.8)), size: { width: mm(30) } }));
const nameplate = { enabled: true, slot: { elements: [
  depth(9), // nine grid lines; the rules and the dateline hang from the foot
  { kind: 'rule', id: 'foot', thickness: pt(0.5), color: col('ink'),
    placement: { ...at('#depth', 'align-bottom', 0, -2), size: { width: 'fill' } } },
  ...[['left', '{attr.issue}'], ['center', '{publishDate}'], ['right', '{attr.price}']].map(
    ([align, content]) => text(`date-${align}`, content, { ...caps(8, 600), align },
      { ...at('#foot', 'above', 0, -1.5), size: { width: 'fill' } })),
  rule('thin', '#date-left', 0.5, 1.6), rule('heavy', '#thin', 3, 0.7),
  text('name', '{titleText}', { fontFamily: 'Playfair Display', fontSize: pt(64),
    fontWeight: 900, lineHeight: 1, align: 'center' },
  { ...at('#heavy', 'above', 0, -2.5), size: { width: 'fill' } }),
  ...ear('left', [['w-kicker', 'Weather', caps(7.5, 700, 'accent')],
    ['w-outlook', '{attr.outlook}', { fontFamily: 'Newsreader', fontSize: pt(9.5), italic: true,
      lineHeight: 1.25 }], ['w-temps', '{attr.temps}', sans(17, 700)]]),
  ...ear('right', [['t-kicker', 'Tides', caps(7.5, 700, 'accent')],
    ['t-times', '{attr.tides}', { fontFamily: 'Newsreader', fontSize: pt(9.5), italic: true,
      lineHeight: 1.25 }], ['t-height', '{attr.height}', sans(17, 700)]]),
] } };

# The Corrington Despatch使用front标题样式:报名为64 pt的Playfair Display Black,两个报眼由标题属性填充,日期行夹在一细一粗两条线之间。首页设计高九条网格线。其下的浅色导读条是一个通页宽的框,是头版自己的一个要素:它结束首页设计所在的横带,头条的标题框占用它开出的横带的第1至4栏。没有导读条时,标题框也会紧贴在首页设计下方占这四栏,因为首页设计下方第1栏的栏首和其他各栏的栏首一样是一个空位(在postext 1.24及以前不是,标题框会从第2栏开始)。

#5 · 评论版改为五栏

script.js · 第123–144行在完整代码中
const flag = { enabled: true, slot: { elements: [
  depth(4),
  { kind: 'rule', id: 'bar', thickness: pt(3), color: col('ink'),
    placement: { ...at('#depth', 'align-bottom', 0, -2.5), size: { width: 'fill' } } },
  text('flag', '{titleText}', { fontFamily: 'Playfair Display', fontSize: pt(30),
    fontWeight: 900, lineHeight: 1 }, at('#bar', 'above', 0, -1.5)),
  text('tag', '{attr.tag}', { ...caps(8, 600, 'muted'), align: 'right' },
    { ...at('#bar', 'above', 0, -2), size: { width: 'fill' } }),
] } };
const FOLIO = 8; // mm from the top edge to the folio line, its rule 4.5 mm lower
const folio = (parity, side, s) => [ // s: +1 on a verso, −1 on a recto
  text(`n-${parity}`, '{pageNumber}', { ...sans(10, 700), align: side },
    at('page', `top-${side}`, s * MARGIN.side, FOLIO)),
  text(`t-${parity}`, '{title} · {publishDate}', { ...caps(7.5, 600, 'muted'), align: side },
    at(`#n-${parity}`, s > 0 ? 'right-of' : 'left-of', s * 3, 0.9)),
].map((element) => ({ ...element, parity }));
const header = { elements: [...folio('even', 'left', 1), ...folio('odd', 'right', -1),
  { kind: 'rule', id: 'folio-rule', thickness: pt(0.5), color: col('ink'),
    placement: { ...at('page', 'top-left', MARGIN.side, FOLIO + 4.5),
      size: { width: mm(375 - 2 * MARGIN.side) } } }] };
const opinion = { id: 'opinion', advancedDesign: flag, // its section runs in five columns
  layout: { layoutType: 'multiple', columnCount: 5 } }; // 67 mm: a 47-character measure

# Opinion {style="opinion"}开出一个栏目,其标题样式设定layout: { layoutType: 'multiple', columnCount: 5 }。栏目沿用文档的栏间距和栏线,只改栏数,所以社论、评论和来信的行长为67 mm,约47个字符。评论的标题框是columns="3",在社论已从第1栏开始之后才开出,因而落在第2至4栏,照片在其下;两行:::columnbreak把评论送到第2栏,把来信送到第5栏。

完整食谱

沙盒
// ═══ Postext Cookbook · Nº 133 · A broadsheet on six columns ════════════════════
// https://postext.dev/en/cookbook/broadsheet-six-columns
// Code: MIT · Text: original (CC BY 4.0) · Photos: generated (CC BY 4.0)
// Fonts: Newsreader, Playfair Display, Archivo Narrow (SIL OFL 1.1) · Needs postext ≥ 1.65.0
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'broadsheet-six-columns';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: newsprint, a cool ink and one blue
const palette = {
  ink: '#15171a', // text, headlines and the heavy rules
  paper: '#f7f5ef', // newsprint; also type reversed out of a band
  accent: '#164a72', // the paper's blue: kickers, section flags, the fact boxes' stripe
  tint: '#e6ebef', // the fact boxes
  rule: '#8e9196', // hairlines: the column rules, table rules
  muted: '#55595f', // bylines, credits, the folio line
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [ // defaults link to 'main-color': point it at the ink
  ...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 MARGIN = { top: 16, bottom: 14, side: 12 }; // mm: a broadsheet's narrow, even margins
const GUTTER = 4; // mm: six columns of 55.2 mm on the 351 mm text width
const LEAD = 12.2; // pt: the baseline grid under 9 pt text (× 1.36)
const sans = (size, weight, look = {}) => ({ fontFamily: 'Archivo Narrow', fontSize: pt(size),
  fontWeight: weight, color: col('ink'), ...look });
const caps = (size, weight, colour = 'ink') => sans(size, weight, { color: col(colour),
  textTransform: 'uppercase', letterSpacing: pt(size * 0.14) });
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const text = (id, content, look, placement) => ({ kind: 'text', id, content, align: 'left',
  overflow: 'wrap', color: col('ink'), ...look, placement });
const rule = (id, under, weight, gap = 0) => ({ kind: 'rule', id, thickness: pt(weight),
  color: col('ink'), placement: { ...at(under, 'above', 0, -gap), size: { width: 'fill' } } });
// An empty box sets each opener's depth: a whole number of grid lines.
const depth = (lines) => ({ kind: 'box', id: 'depth', style: {}, placement: {
  ...at('container', 'top-left'), size: { width: 'fill', height: pt(lines * LEAD) } } });

// #region nameplate: the front page's H1 is the paper's name, between two ears
const ear = (side, lines) => lines.map(([id, content, look], i) => text(id, content,
  { ...look, align: side }, { ...(i === 0 ? at('container', `top-${side}`, 0, 4)
    : at(`#${lines[i - 1][0]}`, 'below', 0, 0.8)), size: { width: mm(30) } }));
const nameplate = { enabled: true, slot: { elements: [

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

变化

#排成五栏的柏林版

同一份报纸改用315 × 470 mm的柏林版:五栏,每栏55 mm,与对开大报六栏的行长相同。页眉线也改用较窄的宽度,然后逐版重新拼版。

-const layout = { layoutType: 'multiple', columnCount: 6, gutterWidth: mm(GUTTER),
+const layout = { layoutType: 'multiple', columnCount: 5, gutterWidth: mm(GUTTER),
-      size: { width: mm(375 - 2 * MARGIN.side) } }] };
+      size: { width: mm(315 - 2 * MARGIN.side) } }] };
-  page: { sizePreset: 'broadsheet', dpi: 150, backgroundColor: col('paper'), // 375 × 597 mm
+  page: { sizePreset: 'berliner', dpi: 150, backgroundColor: col('paper'), // 315 × 470 mm

常见问题

易错点

位图的印刷尺寸取自分辨率:声明分辨率,不要换算印刷像素

没有分辨率的位图按文档dpi以一个像素对应一个排版像素放置,所以2400 px的照片在150 dpi的页面上宽406 mm。声明文件的实际像素,并给图片设分辨率(bitmap.resolution: 300),或为所有位图设置layout.bitmapResolution:一个ppi值,或用'file'读取文件标明的分辨率。栏宽仍会限制图片。 作为资源的图和表 →

  • 浮动体若在正文已经走过它的那几栏之后才开出,本版就没有位置,会开到下一版。头版的头条必须在第4栏结束:多一段,第二条新闻的标题和照片就会移到第2版。
  • 每一版都要像编辑拼版那样手工调整:广告里的:::space行数和每篇稿子的长度决定各栏在哪里结束。改了一篇稿子,就要重新拼那一版。

致谢

文本
原创文字, CC BY 4.0
图片
  • The Eastern Quays at sunrise (the front-page lead photograph) · Generated With Diffusion Models · CC BY 4.0
  • Engineers watching a river flood gate (front page, second story) · Generated With Diffusion Models · CC BY 4.0
  • A terraced street on moving day (page 2) · Generated With Diffusion Models · CC BY 4.0
  • A Victorian swimming baths on a weekday morning (page 3) · Generated With Diffusion Models · CC BY 4.0
  • A period drama on a theatre stage (page 4) · Generated With Diffusion Models · CC BY 4.0
字体
Newsreader (SIL OFL 1.1) · Playfair Display (SIL OFL 1.1) · Archivo Narrow (SIL OFL 1.1)
沙盒