A report that lays itself out

Placing a page by hand means knowing, before you write a word, how tall every paragraph will be. Translate one of them and every number below it is wrong; add a line to a table and the footnote lands on top of the page number. That bill arrives months later, when the report has to change and nothing in the code says which of its figures were holding it together.

Where the two pages divide is not chosen by hand either, which is why the French report and the English one below come out of one and the same program: the French runs longer, the break falls somewhere else, and nothing had to be adjusted for it. The only height anybody fixed in this example is the one the page number sits at — and that belongs to the page, not to anything said on it.

What this example shows

  • Blocks stacked in reading order: text, a table, rules and gaps.
  • A table cut row by row, its heading row repeated on the next page.
  • A paragraph held together rather than left with one line alone.

The source code, complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The document itself

Open the document in English Open the document in French

Examples near this one

Breaking an overlong word

A word longer than the column that holds it: the library leaves it whole, or cuts it at the column's edge.

Break points after a slash or a hyphen

A justified column set twice: file paths and compounds running past the edge with no break points, then wrapping where a break after a slash or a hyphen is allowed.

A font behind the font

One line of statuses set twice: in a company font alone, where the characters it has no glyph for come out as empty boxes, then with a second font behind it that draws them.

What a font knows about its own letters

Four samples set twice each, once plain and once with a single setting activated: joined letters, small capitals, figures that hang below the line, and pairs moved closer together.

Every example, by subject