In short
A famous Soviet poem whose lines go down the page like a staircase. Each step starts where the one above it ends, and the pages are printed in red and black like the posters of its time.
What you'll build
Стихи о советском паспорте (Verses on My Soviet Passport, 1929), complete, on four pages of 170 × 260 mm. Mayakovsky broke his lines into steps, each one starting where the last one stopped, and the Complete Works count every step as a line. The poem runs 43, 43 and 29 steps to a page in Golos Text at 12.5 on 14.6 pt, with the phrases that name the passport in heavy red. The last sentence stands in a red field at the foot of page 4. The cover, the folio tabs and the field are flat shapes in black, red and raw paper, after El Lissitzky's layouts for Mayakovsky.
This recipe answers
- How do I set stepped verse (Mayakovsky's lesenka), with each step starting where the one above ends?
- How do I set poetry: one line per verse, stanza gaps, hanging indents for wrapped lines, no hyphenation?
The short answer
// 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 } },
];
Each step on its own line, led by a plus sign
Ingredients
- Features
- Verse line by lineCyrillic languages as the document languageText, rules and boxes in page designsWords kept together at line endsLine numbersDesigned openersHeading stylesHeading attributesCovers, title pages and colophonsCharacter stylesParagraph stylesPinned boxes and badgesCallout boxesTrim sizeDocument metadataSemantic colour palettePDF exportFonts embedded in the PDF
- Also uses
- Paper colourPage and column breaksHeads by page roleLine breaks in titlesUnnumbered chapters
- Type
- Golos Text, Sofia Sans Extra Condensed (SIL OFL 1.1)
- Assets
- None: every picture is drawn in code
Method
#1 · Type every step with a plus sign
The code is the short answer above. Inside a :::verse fence, the first step of a line is typed as it is and each of the others starts with + . The engine places it a word space after the end of the step above. Nothing has to be counted in spaces or tabs, so another face or size moves the whole staircase with it. A step that would cross the measure moves back until it fits; only a step wider than the measure itself turns over, and it hangs below its own start.
#2 · Raise the voice in red
const characterStyles = [{ id: 'loud', name: 'Loud', fontWeight: 900, color: col('red') }];
The books Lissitzky designed for Mayakovsky shout with weight and colour. A character style does it here: :span[Но эту…]{style="loud"} takes Golos Text 900 and the red, and since the next step is measured from its end, the staircase stays true.
#3 · Number every tenth step
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 counts the lines of a poem, and a step is a line. The poem is written as one fence a page, so lineStart=44 and lineStart=87 go on with the count. The column starts at the trim, which lets the red field bleed; the paragraph style indents the verse 38 mm and a negative gap brings the numbers in.
#4 · Draw the cover with paths
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),
];
Path elements take points in millimetres through a viewBox the size of the page. Paths are not rotated, so bar works out its four corners on a slant of 17 degrees. The shapes live in the header slot with pages: 'opener', since a heading's design is clipped at the foot of the text area. The title steps too: о советском is anchored to the right of Стихи.
#5 · Set the folio in a thumb tab
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) };
A black box flush with the fore-edge carries the page number, left on versos and right on rectos, in memory of the cut thumb index of For the Voice. pages: 'body' keeps it off the cover.
#6 · Close in a red field
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)];
The last five steps are a :::callout of their own, fixed to the foot of the page and as wide as it. The fence inside takes the shout style: Sofia Sans Extra Condensed 900 at 29 pt. The colophon is a second box under it, and the strip of paper between the two is the white line of a poster.
The whole recipe
// ═══ 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 +:
// К любым
// + чертям с матерями
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)
Pitfalls
- A line that really begins with a plus sign is written
\+. - At a larger size the steps of a long line run out of room and the last ones move back, which looks like a mistake. The sentence in the red field needs 123 mm at 29 pt; check the longest line before you enlarge it.
Credits
- Recipe
- Ignacio Ferro
- Text
- Стихи о советском паспорте, 1929, complete, after the Complete Works in thirteen volumes (vol. 10, 1958) in the transcription of ru.wikisource · Vladimir Mayakovsky · public domain
- The colophon · Postext Cookbook · original
- Fonts
- Golos Text (SIL OFL 1.1) · Sofia Sans Extra Condensed (SIL OFL 1.1)
Edit this write-up ↗ (opens in a new tab)Recipe folder on GitHub ↗ (opens in a new tab)


