本文へスキップ
レシピ番号133

レシピ集 · 第1章 · ページとグリッド

ブランケット判6段の日刊紙

ブランケット判の日刊紙4ページ。罫線付きの6段、2〜5段にまたがる写真と囲み、全段の広告、5段に切り替えたオピニオン面。

このページの内容

1ページ(全4ページ)

  • 英語の見本:日本語版はまだありません
  • 仕上がり375 × 597 mm
  • 6段, 段間4 mm
  • Newsreader 9/12.2
  • Archivo Narrow
  • Playfair Display
  • 4ページ
  • レベル
  • Postext 1.65.0
  • 組版時間140 ms
  • コード247行

かんたんな説明

大判の日刊紙4ページを、細い6段で組む例です。写真や囲みを何段かにまたがらせる方法と、1ページだけ5段にする方法を示します。

できあがり

架空の日刊紙 The Corrington Despatch の4ページを、375 × 597 mmのブランケット判で組みます。本文は幅55.2 mmの6段で、段間4 mmにそれぞれ細い罫が入ります。9 ptで1行およそ38字、実際のブランケット判と同じ行長です。第1面には天気と潮汐の小枠を両脇に置いた題字、案内の帯、見出しと写真が4段にまたがるトップ記事、2段写真付きの2番手記事、短信の段、財源の表と2段のデータ囲み、下端の広告があります。第2面は第1面の続きから始まり、第3面は5段に切り替えて社説、論評、投書を載せ、終面には劇評と天気が入ります。

このレシピが答える質問

  • 新聞のページを組むには(ブランケット判に5段、2段にまたがる写真、3段にまたがる記事の囲み)?
  • Postextは3段以上の段組みや、画像の周りへの回り込みに対応していますか?

手短な答え

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 · ブランケット判に6段

この手順のコードは上の手短な答えです。page.sizePreset: 'broadsheet'で375 × 597 mmの判型になり、layoutType: 'multiple'とcolumnCount: 6で幅351 mmの版面を等幅の6段に分けます(レイアウトの種類)。1段は(351 − 5 × 4) / 6 = 55.2 mmで、9 ptのNewsreaderなら約38字。そのため本文にはハイフネーションが要り、minWordSpacing: 0.8で語間が詰まりすぎないようにし、maxJustifyTracking: 15で間延びした行のすき間を字間に配ります。段間罫は各段間に0.4 ptの細線を引き、段をまたぐフロートや囲みのところで途切れます。postext 1.17までは本文は2段が上限で、そのためNo. 027は4段の短信を囲みの中に入れていました。

#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は写真や表の幅を、段間を含めた段数で指定します。第1面の4段は232.7 mmです。エンジンは本文のある段から左へ右へと場所を探します。topのフロートは、まだ本文がなく天がそろったk段の並びのうち最初のものの頭に入り、bottomのフロートは本文のある段とその後の空き段の足に入ります。そのため3段目の段落で参照した財源の表は3・4段目の下に置かれます。第2面では、先に書いたデータ囲みが1・2段目をとるので、3〜6段目が次の4段写真のための最初のそろった並びになります。順番を逆にすると、囲みは写真の下に積まれます。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は、写真と同じように4段にまたがって浮きます。トップ記事の見出しとリードはこの囲みで、本文の前に書くので1〜4段目をとり、写真はその下に積まれます。2番手記事の見出しの囲みはトップ記事の後、:::columnbreakの後ろに置きます。このとき本文はもう5段目にあり、5・6段目が最初の空いた2段になります。広告はどれもcolumns="6"の全段の囲みで、本文が来る前に下端を確保するよう、そのページの冒頭に書きます。第2面と第4面の続き見出しはNo. 027と同じく全幅の囲みです。ここではどのページもひとつのセクションを閉じるので、balancing.trailing: falseで各段を下端まで埋めます。fillShortColumns: trueは、ウィドウ・オーファンの規則で1行短くなった段に、その段自身の段落から1行を足します。第4面では劇評の3段目がそろいます。

#4 · 題字は第1面の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、両脇の小枠は見出しの属性から埋まり、日付行は細い罫と太い罫に挟まれます。オープナーの深さは行送り9行分です。その下の地色の案内帯は全幅の囲みで、1面そのものの要素です。オープナーの帯を閉じ、トップ記事の見出しの囲みは、案内帯が開く帯の1〜4段目をとります。案内帯がなくても、囲みはオープナーのすぐ下で同じ4段をとります。オープナーの下では、1段目の先頭もほかの段の先頭と同じ空き位置だからです(postext 1.24までは違い、囲みは2段目から始まっていました)。

#5 · オピニオン面は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段目に入り、写真はその下に来ます。2行の:::columnbreakが論評を2段目へ、投書を5段目へ送ります。

レシピの全体

Sandbox
// ═══ 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上のレシピのフォルダー ↗ (新しいタブで開きます)

アレンジ

#ベルリナー判を5段で組む

同じ新聞を315 × 470 mmのベルリナー判にすると、5段で1段55 mm、ブランケット判6段と同じ行長です。柱の罫も狭い幅に合わせ、各ページを割り付け直します。

-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で1ピクセルを1レイアウトピクセルとして置かれるため、2400 pxの写真は150 dpiのページで幅406 mmになります。ファイルの実際のピクセル数を宣言し、画像に解像度を与える(bitmap.resolution: 300)か、すべてのビットマップにlayout.bitmapResolutionを設定します。値はppi、またはファイルが記す解像度を読む'file'です。段の幅は引き続き画像の上限になります。 リソースとしての図と表 →

  • 本文がすでに通り過ぎた段に向けて書いたフロートは、そのページに場所がなく、次のページに回ります。第1面のトップ記事は4段目で終わらなければならず、1段落増えるだけで2番手記事の見出しと写真が第2面へ移ります。
  • どのページも、整理記者が紙面を割り付けるように手で合わせます。広告の:::spaceの行数と各記事の長さが、段の終わる位置を決めます。記事を変えたら、そのページを割り付け直してください。

クレジット

レシピ
Ignacio Ferro
本文
書き下ろしの文章, 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)
Sandbox