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

レシピ集 · 第2章 · 文字と本文

マヤコフスキーの階段詩を打ち、組む

マヤコフスキーの1929年の詩を全篇、赤と黒の4ページに。階段の各段はプラス記号で打ち、10段ごとに番号を振り、最後の一文を赤い地に大きく組みます。

このページの内容
ジャンル
詩歌
出力
Canvas · PDF
レベル
中級
Postext
Postext 1.100.0で検証済み
1.100.0以上が必要 · postext-pdf ≥ 1.100.0
ライセンス
2026年12月2日更新
コードMIT · 本文MIT

4ページ(全4ページ)

  • 英語の見本:日本語版はまだありません
  • 仕上がり170 × 260 mm
  • 1段
  • Golos Text 12.5/14.6
  • Sofia Sans Extra Condensed
  • 4ページ
  • レベル
  • Postext 1.100.0
  • 組版時間50 ms
  • コード136行

かんたんな説明

詩の行が階段のようにページを下りていく、ソ連の有名な詩です。どの段も上の段が終わったところから始まり、ページは当時のポスターのように赤と黒で刷られています。

できあがり

『ソヴィエトのパスポートの詩』(Стихи о советском паспорте、1929年)の全篇を、170 × 260 mmの4ページに組みます。マヤコフスキーは詩行を段に割り、どの段も前の段が止まったところから始めました。全集は一段を一行と数えます。本文はGolos Text 12.5 pt、行送り14.6 ptで、各ページ43段、43段、29段。パスポートを指す語句は極太の赤です。最後の一文は4ページの下の赤い地に置きます。表紙もノンブルのタブも赤い地も、黒と赤と紙の色だけの平らな図形で、リシツキーがマヤコフスキーのために作った紙面にならいました。

このレシピが答える質問

  • 階段詩(マヤコフスキーのレーセンカ)を、各段が上の段の終わりから始まるように組むには?
  • 詩を組むには(1行に1詩行、連の間のアキ、折り返した行のぶら下げインデント、ハイフネーションなし)?

手短な答え

script.js · 46〜66行コード全体で見る
// A line of verse typed as the book prints it, its steps marked +:
//   К любым
//   + чертям с матерями
//   + катись
// A step starts a word space after the end of the step above, so the steps keep the rhyme's
// line whole whatever the face or the size. They are lines: nothing joins them or divides
// them, and they are not hyphenated. A step that would run past the measure moves back until
// it fits; one wider than the whole measure turns over, `hang` in from its own start.
// align=start on the fence sets the poem flush left; by default it is centred.
const LOCALE = 'ru';
const verse = { turnover: 'hang', hang: em(2), tighten: true }; // config().bodyText.verse
const paragraphStyles = [
  { id: 'step', fontFamily: TEXT, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
    textAlign: 'left', indent: mm(38), firstLineIndent: pt(0),
    marginTop: pt(0), marginBottom: pt(0) },
  { id: 'shout', fontFamily: DISPLAY, fontWeight: 900, fontSize: pt(29), lineHeight: pt(27),
    color: col('paper'), textAlign: 'left', firstLineIndent: pt(0), marginTop: pt(0),
    marginBottom: pt(0) },
  { id: 'colophon', fontSize: pt(7.6), lineHeight: pt(10), color: col('paper'),
    textAlign: 'left', firstLineIndent: pt(0), hyphenation: { enabled: false } },
];

材料

種類
Golos Text, Sofia Sans Extra Condensed (SIL OFL 1.1)
素材
なし:画像はすべてコードで描画

作り方

#1 · 段をプラス記号で打つ

コードは上の手短な答えです。:::verseの囲みの中で、詩行の最初の段はそのまま、残りの段は+ で始めます。組版エンジンはその段を、上の段の終わりから語間ひとつ置いて始めます。空白やタブを数える必要がないので、書体や大きさを変えると階段全体がついてきます。行長からはみ出る段は収まるところまで戻り、行長そのものより広い段だけが折り返して、自分の頭の下にぶら下がります。

#2 · 赤で声を上げる

script.js · 70行コード全体で見る
const characterStyles = [{ id: 'loud', name: 'Loud', fontWeight: 900, color: col('red') }];

リシツキーがマヤコフスキーのために作った本は、太さと色で叫びます。ここでは文字スタイルがその役です。:span[Но эту…]{style="loud"}はGolos Text 900と赤になり、次の段はその終わりから測られるので、階段は狂いません。

#3 · 10段ごとに番号を振る

script.js · 74〜76行コード全体で見る
const lineNumbers = { enabled: true, count: 'verse', restart: 'document', interval: 10,
  position: 'left', gap: mm(-32), // the column starts at the trim: 32 mm in from its edge
  fontFamily: DISPLAY, fontWeight: 900, fontSize: pt(13), color: col('red') };

lineNumbersは詩の行を数え、一段は一行です。詩はページごとに囲みを一つにし、lineStart=44とlineStart=87で数えを続けます。段組みは裁ち落としの線から始め、赤い地を裁ち切りにします。段落スタイルが詩を38 mm下げ、負のgapが番号を内側へ寄せます。

#4 · 表紙をパスで描く

script.js · 80〜99行コード全体で見る
const P = [60, 78]; // the passport's top corner
const flat = { pages: 'opener' }; // the shapes: in the header slot, for the cover alone
const cover = { id: 'cover', numbered: false, breakBefore: { enabled: true, parity: 'odd' },
  advancedDesign: { enabled: true, slot: { elements: [
    text('year', '{attr.year}', 28, 'ink', at('page', 'top-right', -14, 15)),
    text('one', '{attr.one}', 52, 'ink', at('page', 'top-left', 14, 182)),
    text('two', '{attr.two}', 52, 'red', { ...at('#one', 'right-of', 3, 17) }),
    text('three', '{attr.three}', 118, 'ink', at('page', 'bottom-left', 14, -12)),
  ] } } };
const coverShapes = [
  poly('field', 'ink', [[0, 0], [124, 0], [0, 176]], flat),
  disc('sun', 'paper', 88, 92, 52, flat),
  bar('ray', 'ink', -6, 180, 190, 3, flat),
  bar('passport', 'red', ...P, 74, 100, flat),
  disc('seal', 'paper', ...on(...P, 37, 39), 17, flat),
  disc('eye', 'ink', ...on(...P, 37, 39), 9, flat),
  ...[48, 36, 24].map((len, i) =>
    bar(`line-${i}`, 'paper', ...on(...P, 13, 68 + 9 * i), len, 4, flat)),
  text('author', '{author}', 26, 'paper', at('page', 'top-left', 14, 15), flat),
];

viewBoxをページと同じ大きさにすると、パスの点をミリで書けます。パスは回転しないので、barが17度の傾きで四隅を計算します。図形はpages: 'opener'で柱の枠に置きます。見出しのデザインは版面の下端で切れるからです。題名も段になり、о советскомはСтихиの右に留めてあります。

#5 · ノンブルをタブに入れる

script.js · 103〜113行コード全体で見る
const tab = (parity, edge, x) => [
  { kind: 'box', id: `tab-${parity}`, parity, pages: 'body', style: { backgroundColor: col('ink') },
    placement: { ...at('page', edge, 0, 22), size: { width: mm(13), height: mm(20) } } },
  text(`folio-${parity}`, '{pageNumber}', 26, 'paper', at('page', edge, x, 28),
    { parity, pages: 'body' }),
];
const header = { elements: [...coverShapes, ...tab('even', 'top-left', 4.6),
  ...tab('odd', 'top-right', -4.6)] };
const LINES = 43; // three pages of 43, 43 and 29 steps, and five in the red field
const margins = { top: mm(22), bottom: mm(H - 22 - (LINES * LEAD * 25.4) / 72 - 0.1),
  left: mm(0), right: mm(0) };

小口に接した黒い箱がノンブルを載せます。偶数ページは左、奇数ページは右で、『声のために』の抜きの見出しを思い出させます。pages: 'body'で表紙には出しません。

#6 · 赤い地で終える

script.js · 117〜121行コード全体で見る
const box = (id, y, top, bottom) => ({ id, placement: 'fixed', background: col('red'),
  fixed: { anchor: { to: 'page', edge: 'bottom-left' }, offset: { x: mm(0), y: mm(y) } },
  stripe: { enabled: false },
  padding: { top: mm(top), right: mm(14), bottom: mm(bottom), left: mm(14) } });
const calloutStyles = [box('finale', -20.6, 10, 5), box('colophon', 0, 2, 8)];

最後の5段は独立した:::calloutで、ページの下に固定し、ページと同じ幅にします。中の囲みはshoutスタイル、Sofia Sans Extra Condensed 900の29 ptです。奥付はその下の二つ目の箱で、間に残る紙の帯がポスターの白い線になります。

レシピの全体

Sandbox
// ═══ Postext Cookbook · Nº 206 · Mayakovsky in steps: the lesenka as he printed it ═════
// https://postext.dev/en/cookbook/stepped-verse-lesenka
// Code: MIT · Text: V. Mayakovsky, Стихи о советском паспорте, 1929 (PD; PSS, vol. 10)
// Fonts: Sofia Sans Extra Condensed, Golos Text (SIL OFL 1.1) · Needs postext ≥ 1.100.0
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the colophon ('en' | 'es' | 'ru')
const RECIPE = 'stepped-verse-lesenka';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Two inks on a raw paper, as the Constructivists printed: black, vermilion, no third.
const palette = {
  ink: '#171412', // the verse, the fields
  red: '#c9281b', // the passport, the loud steps, the last page
  paper: '#f0e7d6', // an unbleached stock
};
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: 'red (defaults)', value: { hex: palette.red, model: 'hex' } },
];
const [TEXT, DISPLAY] = ['Golos Text', 'Sofia Sans Extra Condensed'];
const [BODY, LEAD] = [12.5, 14.6]; // pt
const [W, H] = [170, 260]; // mm: the sheet 70 × 108/16 of GOST 5773
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const text = (id, content, size, color, placement, extra = {}) => ({ kind: 'text', id, content,
  fontFamily: DISPLAY, fontWeight: 900, fontSize: pt(size), lineHeight: 0.8, color: col(color),
  textTransform: 'uppercase', placement, ...extra });
// A flat shape in millimetres of the page: a polygon from its points, a disc from its radius.
const shape = (id, color, d, extra = {}) => ({ kind: 'path', id, d, viewBox: [W, H],
  fill: col(color), ...extra, placement: { ...at('page', 'top-left'),
    size: { width: mm(W), height: mm(H) } } });
const poly = (id, color, points, extra) =>
  shape(id, color, `M${points.map((p) => p.join(' ')).join('L')}Z`, extra);
const disc = (id, color, x, y, r, extra) => shape(id, color,
  `M${x - r} ${y}A${r} ${r} 0 1 1 ${x + r} ${y}A${r} ${r} 0 1 1 ${x - r} ${y}Z`, extra);
// A bar laid along a slant: `len` from (x, y) on the passport's own axes, `wide` across it.
const [UX, UY] = [Math.cos(-0.3), Math.sin(-0.3)]; // the slant: 17 degrees
const bar = (id, color, x, y, len, wide, extra) => poly(id, color, [[x, y],
  [x + len * UX, y + len * UY], [x + len * UX - wide * UY, y + len * UY + wide * UX],
  [x - wide * UY, y + wide * UX]].map((p) => p.map((n) => Math.round(n * 100) / 100)), extra);
const on = (x, y, u, v) => [x + u * UX - v * UY, y + u * UY + v * UX]; // a point on those axes

// #region answer: each step on its own line, led by a plus sign
// A line of verse typed as the book prints it, its steps marked +:
//   К любым
//   + чертям с матерями

組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)

よくあるつまずき

  • 本当にプラス記号で始まる行は\+と書きます。
  • 大きくすると長い行の段が収まらず、最後の段が戻って間違いのように見えます。赤い地の一文は29 ptで123 mm必要です。大きくする前に一番長い行を確かめてください。

クレジット

レシピ
Ignacio Ferro
本文
  • Стихи о советском паспорте, 1929, complete, after the Complete Works in thirteen volumes (vol. 10, 1958) in the transcription of ru.wikisource · Vladimir Mayakovsky · パブリックドメイン
  • The colophon · Postext Cookbook · オリジナル
フォント
Golos Text (SIL OFL 1.1) · Sofia Sans Extra Condensed (SIL OFL 1.1)
Sandbox