跳到主要内容
食谱编号146

排版食谱 · 第11章 · 漫画与连环画

报纸上的日更四格和周日半版

报纸的漫画副刊:周日半版排在封面正文里,四格日更漫画横排在四栏文章的下方。

本页内容
输出
Canvas · PDF
难度
高级
Postext
已用Postext 1.65.0测试
需要≥ 1.30.0 · postext-pdf ≥ 1.30.0
许可证
更新于2026年10月12日
代码MIT · 文本CC BY 4.0
  • 成品尺寸230 × 310 mm
  • 1栏
  • Noto Serif SC 8.5/15
  • Noto Sans SC
  • 2页
  • 难度
  • Postext 1.65.0
  • 排版用时455 ms
  • 183行代码

简单来说

报纸漫画版的两页:封面是一大幅彩色漫画;内页是分四栏的漫画家专访,文章下方横着一条四格日更漫画。

成品一览

周末报纸《科灵顿快报》的漫画副刊,折成 230 × 310 mm。封面是《皮普和奥托》的周日半版,讲一只企鹅和一头海象在浮冰上开面包店,下面是内容提要。内页是对漫画家的专访,分四栏排,还有读者来信和一则广告;本周的日更漫画(四个方格)横在文章下方。两组漫画都是报纸正文里的 :::strip 块,副刊有十种语言的版本。

这道食谱解答

  • 怎样在报纸版面上放一条漫画?

简短回答

script.js · 第59–81行在完整代码中
// In the Markdown each strip is a fenced block, where the paper wants it:
//   :::strip{split="55 / * [40 | *]" height=210mm}   the Sunday half page, on the cover
//   :::strip{split="* | * | * | *" span=page}   the daily: four square panels
// On the one-column cover the Sunday strip is set in the text, 210 mm deep. Inside, the daily
// follows the article, as wide as its four columns, and the columns of the article end
// level above it (placement=bottom would float it to the page's foot). A strip never
// splits; one that does not fit moves to the next page.
// The panels, gutters and balloons come from the comics settings, as on a comic page.
const comics = {
  gutter: { horizontal: mm(3), vertical: mm(3) },
  panel: { borderWidth: pt(0.75), borderColor: col('ink'), background: col('paper') },
  lettering: { fontFamily: LETTERING, fontSize: pt(7.5), color: col('ink'), inset: mm(1) },
  balloonStyles: [
    { id: 'speech', fill: col('paper'), stroke: col('ink') },
    { id: 'whisper', fill: col('paper'), stroke: col('ink') },
    { id: 'shout', fill: col('paper'), stroke: col('ink') },
    { id: 'caption', fill: col('accent'), stroke: col('accent'), color: col('paper'),
      fontFamily: LABEL, bold: true },
    { id: 'sfx', fontFamily: SFX, color: col('accent'), haloColor: col('paper') },
  ],
};
const layout = { layoutType: 'multiple', columnCount: 4, gutterWidth: mm(GUTTER),
  columnRule: { enabled: true, color: col('rule'), lineWidth: pt(0.4) } };

用料

类型
Newsreader, Archivo Narrow, Comic Neue, Bangers, Noto Serif SC, Noto Sans SC, ZCOOL KuaiLe, ZCOOL QingKe HuangYou, Noto Serif JP, Noto Sans JP, Zen Antique, Dela Gothic One, Noto Naskh Arabic, Noto Kufi Arabic, Playpen Sans Arabic, Lalezar(SIL OFL 1.1)
素材
  • po1.jpg
  • po2.jpg
  • po3.jpg
  • po4.jpg
  • po5.jpg
  • po6.jpg
  • po7.jpg
  • Strip panel: Pip walks into the bakery (Generated With Diffusion Models, 原创)
  • Strip panel: Otto and the big croissant (Generated With Diffusion Models, 原创)
  • Strip panel: Pip and the croissant on the counter (Generated With Diffusion Models, 原创)
  • Strip panel: Otto eats the croissant (Generated With Diffusion Models, 原创)
  • Strip panel: fishing on the floe (Generated With Diffusion Models, 原创)
  • Strip panel: Pip and his fish (Generated With Diffusion Models, 原创)
  • Strip panel: Otto lands a boot (Generated With Diffusion Models, 原创)

做法

#1 · 把漫画条写在报纸需要的位置

代码就是上面的简短回答。:::strip 的内容和漫画页一样(split、::panel 行和脚本),但它是正文中的一个块(漫画条)。封面只有一栏,周日漫画就排在写它的地方,高 210 mm,内容提要接在后面。它的分割 55 / * [40 | *] 让宽幅的钓鱼场面独占一层,下面一排放两个笑话。漫画条从不拆开:放不下就整个移到下一页。

封面:周日半版排在正文中,下面是内容提要。

#2 · 让日更漫画浮动横跨几栏

内页以一个 H1 开头,它的标题样式把这一节改成四栏。日更漫画写在文章之后,写成 span=page:它排在正文结束的地方,宽度等于四栏,文章的四栏在它上方齐平结束。不写 height 和 aspect 时,漫画条取能让格子成为正方形的比例,这里是四比一。加上 placement=bottom,它会浮动到页面底部,适合文章够长、能排到那里的版面;写成 placement=top 的话,它会出现在下一页的顶部,因为浮动体永远不会排到写它的位置之上。

#3 · 让每幅画面适合自己的格子

script.js · 第257–361行在完整代码中
// From the art manifest; fractions of each picture, the same in every language.
const face = (x, y, width, height) => ({ x, y, width, height });
const ART = {
  po1: { width: 1024, height: 1024, safeArea: face(0.11, 0.22, 0.71, 0.45),
    anchors: [{ id: 'pip', x: 0.27, y: 0.58, face: face(0.11, 0.44, 0.22, 0.2) },
      { id: 'otto', x: 0.67, y: 0.37, face: face(0.56, 0.23, 0.24, 0.22) }] },
  po2: { width: 1024, height: 1024, safeArea: face(0.07, 0.14, 0.79, 0.56),
    anchors: [{ id: 'pip', x: 0.23, y: 0.62, face: face(0.07, 0.5, 0.22, 0.18) },
      { id: 'otto', x: 0.75, y: 0.31, face: face(0.52, 0.14, 0.33, 0.22) }],
    avoid: [face(0.28, 0.17, 0.38, 0.39)] },
  po3: { width: 1024, height: 1024, safeArea: face(0.03, 0.18, 0.72, 0.56),
    anchors: [{ id: 'pip', x: 0.275, y: 0.36, face: face(0.1, 0.19, 0.25, 0.21) }],
    avoid: [face(0.34, 0.41, 0.64, 0.41)] },
  po4: { width: 1024, height: 1024, safeArea: face(0.07, 0.19, 0.84, 0.53),
    anchors: [{ id: 'pip', x: 0.23, y: 0.61, face: face(0.07, 0.48, 0.22, 0.18) },
      { id: 'otto', x: 0.69, y: 0.36, face: face(0.53, 0.19, 0.39, 0.23) }],
    avoid: [face(0.31, 0.63, 0.05, 0.08), face(0.39, 0.32, 0.29, 0.18)] },
  po5: { width: 1400, height: 600, safeArea: face(0.16, 0.17, 0.6, 0.66),
    anchors: [{ id: 'pip', x: 0.345, y: 0.53, face: face(0.29, 0.4, 0.09, 0.18) },
      { id: 'otto', x: 0.625, y: 0.33, face: face(0.58, 0.17, 0.12, 0.23) }] },
  po6: { width: 1152, height: 1152, safeArea: face(0.3, 0.21, 0.43, 0.35),
    anchors: [{ id: 'pip', x: 0.46, y: 0.39, face: face(0.35, 0.25, 0.2, 0.18) },
      { id: 'fish', x: 0.66, y: 0.46, face: face(0.64, 0.41, 0.07, 0.12) }] },
  po7: { width: 1400, height: 933, safeArea: face(0.07, 0.15, 0.81, 0.65),
    anchors: [{ id: 'pip', x: 0.195, y: 0.64, face: face(0.1, 0.56, 0.15, 0.14) },
      { id: 'otto', x: 0.795, y: 0.35, face: face(0.7, 0.18, 0.18, 0.22) },
      { id: 'sfx', x: 0.62, y: 0.7 }],
    avoid: [face(0.44, 0.3, 0.15, 0.32)] },
};
const ALT = {
  po1: t({ en: 'Pip the penguin waddles into Otto the walrus’s tiny bakery, waving.',
    es: 'Pip, el pingüino, entra saludando en la pequeña panadería de Otto, la morsa.',
    ca: 'En Pip, el pingüí, entra saludant a la petita fleca de l’Otto, la morsa.',
    zh: '企鹅皮普摇摇摆摆走进海象奥托的小面包店,挥着手。',
    ar: 'البطريق بيب يدخل مخبز الفظّ أوتو الصغير وهو يلوّح.',
    ja: 'ペンギンのピップが手を振りながら、セイウチのオットーの小さなパン屋に入ってくる。',
    pt: 'O pinguim Pip entra acenando na padariazinha da morsa Otto.',
    fr: 'Pip le manchot entre en saluant de la main dans la petite boulangerie d’Otto le morse.',
    de: 'Der Pinguin Pip watschelt winkend in die kleine Bäckerei des Walrosses Otto.',
    it: 'Il pinguino Pip entra salutando con la mano nella piccola panetteria del tricheco '
      + 'Otto.' }),
  po2: t({ en: 'Otto proudly holds up a croissant as big as Pip.',
    es: 'Otto enseña orgulloso un cruasán tan grande como Pip.',
    ca: 'L’Otto ensenya orgullós un croissant tan gran com en Pip.',
    zh: '奥托得意地举起一个和皮普一样大的羊角面包。',
    ar: 'أوتو يرفع بفخر كرواسونًا بحجم بيب.',
    ja: 'オットーが、ピップと同じくらい大きなクロワッサンを得意げに持ち上げる。',
    pt: 'Otto ergue, todo orgulhoso, um croissant do tamanho do Pip.',
    fr: 'Otto brandit fièrement un croissant aussi grand que Pip.',
    de: 'Otto hält stolz ein Croissant hoch, so groß wie Pip.',
    it: 'Otto mostra tutto fiero un cornetto grande quanto Pip.' }),
  po3: t({ en: 'Pip stands on the counter next to the giant croissant, scratching his head.',
    es: 'Pip, de pie en el mostrador junto al cruasán gigante, se rasca la cabeza.',
    ca: 'En Pip, dret al taulell al costat del croissant gegant, es grata el cap.',
    zh: '皮普站在柜台上,挨着巨大的羊角面包挠头。',
    ar: 'بيب واقف على المنضدة بجانب الكرواسون العملاق يحكّ رأسه.',
    ja: 'ピップがカウンターの巨大なクロワッサンの横に立ち、頭をかいている。',
    pt: 'Pip, de pé no balcão ao lado do croissant gigante, coça a cabeça.',
    fr: 'Pip, debout sur le comptoir à côté du croissant géant, se gratte la tête.',
    de: 'Pip steht auf der Ladentheke neben dem Riesencroissant und kratzt sich am Kopf.',
    it: 'Pip, in piedi sul bancone accanto al cornetto gigante, si gratta la testa.' }),
  po4: t({ en: 'Otto munches the big half of the croissant; Pip holds a tiny end piece.',
    es: 'Otto se come la mitad grande del cruasán; Pip sostiene una punta diminuta.',
    ca: 'L’Otto es menja la meitat gran del croissant; en Pip aguanta una punta minúscula.',
    zh: '奥托大口吃着大半个羊角面包;皮普手里拿着一小截面包尖。',
    ar: 'أوتو يلتهم النصف الكبير من الكرواسون، وبيب يمسك طرفًا صغيرًا.',
    ja: 'オットーがクロワッサンの大きいほうをほおばり、ピップは小さな端っこを持っている。',
    pt: 'Otto devora a metade grande do croissant; Pip segura uma pontinha.',
    fr: 'Otto dévore la grosse moitié du croissant ; Pip tient un minuscule bout.',
    de: 'Otto mampft die große Hälfte des Croissants; Pip hält ein winziges Endstück.',
    it: 'Otto divora la metà grande del cornetto; Pip tiene in mano una punta minuscola.' }),
  po5: t({ en: 'Pip and Otto fish through a hole in an ice floe beside a tiny bakery hut.',
    es: 'Pip y Otto pescan por un agujero en un témpano, junto a una caseta de panadería.',
    ca: 'En Pip i l’Otto pesquen per un forat en un glaç, al costat d’una caseta de fleca.',
    zh: '皮普和奥托在浮冰的冰洞里钓鱼,旁边是一间小面包屋。',
    ar: 'بيب وأوتو يصطادان من ثقب في جليد طافٍ بجانب كوخ مخبز صغير.',
    ja: '流氷の穴でピップとオットーが釣りをしている。そばに小さなパン屋の小屋。',
    pt: 'Pip e Otto pescam num buraco do bloco de gelo, ao lado de uma padariazinha.',
    fr: 'Pip et Otto pêchent par un trou dans la banquise, à côté d’une petite cabane de '
      + 'boulangerie.',
    de: 'Pip und Otto angeln durch ein Loch in einer Eisscholle, neben einer winzigen '
      + 'Bäckerhütte.',
    it: 'Pip e Otto pescano da un buco nella banchisa, accanto a una casetta che fa da '
      + 'panetteria.' }),
  po6: t({ en: 'Pip proudly holds up a tiny, unimpressed fish.',
    es: 'Pip levanta orgulloso un pez diminuto y nada impresionado.',
    ca: 'En Pip aixeca orgullós un peix minúscul i gens impressionat.',
    zh: '皮普得意地举起一条小小的、一脸不屑的鱼。',
    ar: 'بيب يرفع بفخر سمكة صغيرة لا يبدو عليها أي إعجاب.',
    ja: 'ピップが、少しもうれしそうでない小さな魚を得意げに持ち上げる。',
    pt: 'Pip ergue, todo orgulhoso, um peixinho nada impressionado.',
    fr: 'Pip brandit fièrement un poisson minuscule, pas impressionné du tout.',
    de: 'Pip hält stolz einen winzigen Fisch hoch, der wenig beeindruckt aussieht.',
    it: 'Pip mostra tutto fiero un pesciolino minuscolo, per niente impressionato.' }),
  po7: t({ en: 'Otto reels in a soggy boot; Pip has fallen on his back laughing.',
    es: 'Otto saca del agua una bota empapada; Pip se ha caído de espaldas de la risa.',
    ca: 'L’Otto treu de l’aigua una bota xopa; en Pip ha caigut d’esquena de riure.',
    zh: '奥托钓上来一只湿透的靴子;皮普笑得仰面摔倒。',
    ar: 'أوتو يسحب حذاءً مبتلًا، وبيب سقط على ظهره من الضحك.',
    ja: 'オットーがずぶぬれの長靴を釣り上げ、ピップは笑いころげてあおむけに倒れている。',
    pt: 'Otto puxa uma bota encharcada; Pip caiu de costas de tanto rir.',
    fr: 'Otto remonte une botte détrempée ; Pip est tombé à la renverse de rire.',
    de: 'Otto holt einen triefenden Stiefel ein; Pip ist vor Lachen auf den Rücken gefallen.',
    it: 'Otto tira su uno stivale fradicio; Pip è caduto all’indietro dal ridere.' }),
};

画面画成方形或横幅,而周日分割出来的格子并不是这些形状:靴子那个笑话所在的格子是 112 × 88 mm。每个安全区都只保留笑话需要的部分:皮普、奥托和靴子,这样裁切时画面不会留白边(分格与画面)。

#4 · 同一版面印十份报纸

script.js · 第35–49行在完整代码中
const [TEXT, LABEL, LETTERING, SFX] = t({
  en: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  es: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  ca: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  pt: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  fr: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  de: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  it: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  zh: ['Noto Serif SC', 'Noto Sans SC', 'ZCOOL KuaiLe', 'ZCOOL QingKe HuangYou'],
  ja: ['Noto Serif JP', 'Noto Sans JP', 'Zen Antique', 'Dela Gothic One'],
  ar: ['Noto Naskh Arabic', 'Noto Kufi Arabic', 'Playpen Sans Arabic', 'Lalezar'],
});
const CJK = LANG === 'zh' || LANG === 'ja';
// Design text aligns to physical sides: an Arabic page starts on the right.
const [START, END] = LANG === 'ar' ? ['right', 'left'] : ['left', 'right'];

每个版本用适合本文字的字体排报纸,用自己的漫画字体嵌字。日文对话框竖排。日文版和阿拉伯文版都从右往左读漫画,每一排的格子左右对调;阿拉伯文版整页从右往左排,页面的栏也左右对调。画面和分割不变,只换 content.<lang>.md(阅读方向)。

完整食谱

沙盒
// ═══ Postext Cookbook · Nº 146 · A daily strip and a Sunday half page in the newspaper ═══
// https://postext.dev/en/cookbook/newspaper-daily-strip
// Code: MIT · Text: original (CC BY 4.0) · Pictures: generated with diffusion models
// Fonts: Newsreader, Archivo Narrow, Comic Neue, Bangers and 12 more (OFL) · Needs postext ≥ 1.30.0
//
// Two pages of a newspaper's pull-out comics section: a four-panel daily strip across a
// four-column page, under its article, and a Sunday half page with its own panel grid. Both
// are :::strip blocks in the text: the columns end level over one as over a page-wide figure.
import {
  buildDocument, withLoadedFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'zh'; // @lang: 'en' | 'es' | 'ca' | 'zh' | 'ar' | 'ja' | 'pt' | 'fr' | 'de' | 'it'
const RECIPE = 'newspaper-daily-strip';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: newsprint, ink and the paper's red
const palette = {
  ink: '#16181b', // text, rules, panel borders and the lettering
  paper: '#f6f3ec', // newsprint
  accent: '#b3261e', // section flags, kickers and the sound effects
  tint: '#e9e4d8', // the advert's box
  rule: '#8f9196', // the column rules
  muted: '#575b61', // bylines and the folio line
};
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

// #region editions: the newspaper's text, label and lettering faces in each script
const [TEXT, LABEL, LETTERING, SFX] = t({
  en: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  es: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  ca: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  pt: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  fr: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  de: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  it: ['Newsreader', 'Archivo Narrow', 'Comic Neue', 'Bangers'],
  zh: ['Noto Serif SC', 'Noto Sans SC', 'ZCOOL KuaiLe', 'ZCOOL QingKe HuangYou'],
  ja: ['Noto Serif JP', 'Noto Sans JP', 'Zen Antique', 'Dela Gothic One'],
  ar: ['Noto Naskh Arabic', 'Noto Kufi Arabic', 'Playpen Sans Arabic', 'Lalezar'],
});
const CJK = LANG === 'zh' || LANG === 'ja';
// Design text aligns to physical sides: an Arabic page starts on the right.

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

变化

#固定日更漫画的高度

-:::strip{split="* | * | * | *" span=page}
+:::strip{split="* | * | * | *" span=page height=45mm}

#在正文里放一栏宽的漫画条

不写 span=page 时,漫画条和所在栏一样宽,排在写它的地方,就像行内插图。

-:::strip{split="* | * | * | *" span=page}
+:::strip{split="* / * / * / *" aspect=0.25}

常见问题

易错点

'top'浮动体默认排在引用页的下一页,除非允许它置于引用页顶

默认情况下浮动体不会排在自己的引用之前,所以在第N页引用的整页宽'top'浮动体会出现在第N+1页的顶部。在资源或其类型的defaultPlacement上设置placement.citingPage: true(或者对全书设置layout.floatsAtCitingPage,自postext 1.25起),它就改为置于第N页顶部,引用处之上的文字移到它下方,前提是它不超过layout.maxTopFraction且引用行仍留在该页。它不会置于章首页或强制分页之后的页面顶部:那时仍排在下一页,而'auto'或'bottom'可以占用引用页的底部。 图的放置 →

  • 版头由页眉画出,而不是带开篇设计的 H1,所以封面漫画上方只有页码行。
  • 安全区比格子的形状更宽时,画面会留出格子底色的白边,排版给出 comicPanelLetterbox 警告。

致谢

文本
原创文字, CC BY 4.0
图片
  • Strip panel: Pip walks into the bakery · Generated With Diffusion Models · 原创
  • Strip panel: Otto and the big croissant · Generated With Diffusion Models · 原创
  • Strip panel: Pip and the croissant on the counter · Generated With Diffusion Models · 原创
  • Strip panel: Otto eats the croissant · Generated With Diffusion Models · 原创
  • Strip panel: fishing on the floe · Generated With Diffusion Models · 原创
  • Strip panel: Pip and his fish · Generated With Diffusion Models · 原创
  • Strip panel: Otto lands a boot · Generated With Diffusion Models · 原创
字体
Newsreader (SIL OFL 1.1) · Archivo Narrow (SIL OFL 1.1) · Comic Neue (SIL OFL 1.1) · Bangers (SIL OFL 1.1) · Noto Serif SC (SIL OFL 1.1) · Noto Sans SC (SIL OFL 1.1) · ZCOOL KuaiLe (SIL OFL 1.1) · ZCOOL QingKe HuangYou (SIL OFL 1.1) · Noto Serif JP (SIL OFL 1.1) · Noto Sans JP (SIL OFL 1.1) · Zen Antique (SIL OFL 1.1) · Dela Gothic One (SIL OFL 1.1) · Noto Naskh Arabic (SIL OFL 1.1) · Noto Kufi Arabic (SIL OFL 1.1) · Playpen Sans Arabic (SIL OFL 1.1) · Lalezar (SIL OFL 1.1)
沙盒PDF