Paragraph indents and spacing

What separates a page that looks professional from one that does not is rarely the font. It is the room around the paragraphs: how far the first line steps in, how much air sits between two blocks, whether the left edge of a list hangs out or lines up. The same two paragraphs are set six times over here, so each of those numbers can be seen working on its own.

The sixth one settles how far below the top of its rectangle the first line of a block comes to rest. Get it wrong and every block on the page sits a hair out of line with its neighbours.

What this example shows

  • First-line and hanging indents, and a margin on each side.
  • Room before and after a paragraph, stated in points.
  • The last line of a justified paragraph, and the first baseline.

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

Paragraph indents and spacing, first page

Optimised, this document weighs 11.8 kB — at least 85 % lighter than most PDF generators would write it

The document is lighter than it was, and every page still looks exactly the same. See this document's row in the table of every example.

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.

Every example, by subject