Breaking an overlong word

A word too wide for its column: left whole, or cut to the edge.

Every layout meets the word that will not fit: a chemical name, a German compound, a URL, an order reference nobody thought about. The column is narrower than the word, and something has to give. This page sets the same paragraph twice, above as it comes and below cut to the column.

Left alone, the word runs past the right edge and out of the column, which is honest but ugly. Told to break, the engine cuts it at the last letter that fits and carries the rest to the next line. The choice is made block by block, because a table cell and a paragraph of running text do not want the same answer.

What this example shows

  • Overlong words left whole, or cut at the column edge.
  • The two settings shown one above the other on one page.
  • The same choice on table cells, and on text that changes style part-way.

The code, in full

The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.

The document itself

The same document is written in each of these languages. Open the one you want to look at.

Open the document in English Open the document in French

Read the Rust source Read the Python source

First page of Breaking an overlong word

What this document weighs

Before 111,252 bytes
Now 40,892 bytes
Saved 63.2 %

Not one mark on the page changed. See every document measured.

Examples near this one

Soft hyphens and no-break spaces

A justified column set twice: the long words breaking at their soft hyphens with a hyphen shown, or left whole, and a figure a no-break space keeps together.

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.

Text poured into columns

One long passage poured into three columns, each fitting the lines its height allows and handing the rest to the next.

Every example, by subject