Interactive Typesetting
Explore how TeX's algorithms shape text on a page. Every result below was compiled by texlode's LuaTeX engine, the same engine that typesets your documents.
Most word processors break lines greedily, fitting as many words as possible before wrapping. TeX's Knuth–Plass algorithm evaluates every possible breakpoint in the entire paragraph simultaneously, finding the combination that minimizes total unevenness. Drag the sliders to see how the three key parameters affect the result.
Optical margin alignment (microtype protrusion) lets small characters like hyphens, periods, and quote marks hang slightly into the margin. This creates a visually straighter edge even though the characters technically extend past it. Compare the left edges below.
TeX loads language-specific hyphenation patterns compiled from linguistic rules. Different languages break words at different points, and some languages, like German with its long compound words, need hyphenation far more than English does. This narrow column makes the effect especially visible.
The hz-program (font expansion) subtly adjusts individual glyph widths by 1–3% to improve line fitting. The changes are invisible to the eye but measurably reduce the variation in inter-word spacing. Toggle the highlight to see which glyphs were adjusted.