You type plain Latin-script text, and TeX sets it with surprising care: it fuses fi and ff into ligatures, kerns pairs like AV automatically, scans the whole paragraph to choose line breaks and hyphenation, and justifies the edges. This page walks through the four mechanisms behind that — ligatures, kerning, line breaking with hyphenation, and microtype — with the things an author should know and the rare cases where you want to intervene. All of this concerns Western text; Japanese has its own typesetting model.
Ligatures
A ligature fuses several adjacent letters into a single glyph. Because the overhang at the top-right of an f collides with the dot of a following i or the ascender of an l, the f-ligatures have been used since the days of metal type. TeX forms them automatically. The five it makes by default are ff, fi, fl, ffi, and ffl: just type office or fluffier and the relevant letters are replaced by one glyph.
The same machinery builds punctuation ligatures too. A run of hyphens -- becomes an en dash (–, for numeric ranges and the like), and three in a row --- an em dash (—, for parenthetical breaks). Two backticks ` and two apostrophes ''` turn into proper opening and closing double quotation marks. These conversions live in the Western font metrics; no special command is needed.
But when a ligature straddles a morpheme boundary — the seam where a word was built from parts — it can hurt legibility. The classic example is shelfful (shelf + ful): fusing the ff hides the join between shelf and ful. Knuth cites this very word in *The TeXbook* and says it should be set as shelf\/ful. halflife, offhand, and wolffish are of the same kind. Japanese has no such issue, but it is a pitfall worth knowing when setting Western text seriously.
There are three traditional ways to break an unwanted ligature. f\/f inserts an italic correction \/ — a tiny space sized to the letter’s overhang — between the two fs (this is what Knuth used). f{}f inserts an empty group {}. f\kern0pt f inserts a zero-width kern. All three remove the ligature, but note a classic gotcha: putting such a break inside a word can switch off hyphenation for that word. For short words the practical harm is negligible.
shelf\/ful % italic correction — Knuth's example
shelf{}ful % empty group
shelf\kern0pt ful % zero-width kernIf you use LuaLaTeX, the selnolig package is the nicer solution. It carries English morphology as patterns and suppresses the unwanted ligatures automatically in words like shelfful or wolffish — without any markup in your text, and while keeping hyphenation intact. Conversely, to turn off *all* ligatures, microtype (below) can disable them per font in one place.
Kerning
A kern adjusts the gap between a specific pair of adjacent letters — closing or opening it so the spacing looks even. The stock examples are pairs like AV, To, Wa, and LT, which without help look gappy because of the letters’ slants and sidebearings. TeX does this automatically too. Each Western font ships a table of kerning pairs — “close this pair by so much, open that one” — in its font metrics (a .tfm file in the pdfLaTeX world, or a table inside the font for OpenType faces), and TeX reads it to set the spacing.
The key point: both ligatures and kerning are invisible in your source and applied automatically from the font metrics. You normally need not think about them at all. Only when you want to nudge a gap by hand do you add a small space (or a negative one to tighten) with \kern and an explicit length. And to track or letterspace a whole word evenly, do not scatter your own \kerns — use microtype’s \textls (below), which keeps hyphenation working.
Interword spacing, justification & hyphenation
What makes TeX’s setting especially beautiful is that it chooses line breaks by looking at the whole paragraph at once. Where many word processors fix one line at a time, TeX uses the Knuth–Plass algorithm to evaluate whole combinations of breakpoints and pick the division that minimizes how much the interword spaces must stretch or shrink across the paragraph. Justification is achieved in that process by stretching and shrinking the interword glue so the lines reach the same width.
To pack lines well, TeX hyphenates words automatically at syllable boundaries using language-specific hyphenation patterns. The crucial fact is that patterns are language-dependent: breaking German or French by English rules gives wrong results. So you declare the document’s language with babel (or polyglossia for LuaLaTeX/XeLaTeX), which loads the correct patterns for it. This is a prerequisite for setting text correctly, not a decoration.
Automatic hyphenation is clever but can misjudge proper nouns and technical terms. The remedies come in three levels. (1) To make a particular word always break only at chosen points, list it in the preamble in \hyphenation{...}, marking the allowed points with - (words separated by spaces). (2) For a one-off breakpoint, put \- (a discretionary hyphen) inside the word — but note that adding \- means the word can then break only there. (3) To forbid breaking a word at all, wrap it in \mbox{...}.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[english]{babel} % load English hyphenation patterns
\hyphenation{FORTRAN manu-script data-base} % global exceptions
\begin{document}
We rewrote the man\-u\-script in \mbox{FORTRAN} overnight.
\end{document}You can tune how tightly a paragraph packs with two declarations. **\sloppy tolerates wider interword spaces to avoid lines overrunning the margin (overfull boxes), while \fussy** (the default) keeps spacing strict at the cost of more overruns (the “Overfull \hbox” warning). To loosen just one paragraph, wrap it in the sloppypar environment. But \sloppy tends to leave gappy lines, so reworking the wording or adding a single \- usually gives a more beautiful result.
Polishing with microtype
Finally, the package that visibly lifts Western typesetting is microtype. A single line, \usepackage{microtype}, switches on by default the two micro-typographic refinements that pdfTeX provides. One is character protrusion (margin kerning): line-ending punctuation and round or slanted letters like o and A are pushed a hair past the right margin so the edge looks optically even. The other is font expansion: each line’s glyphs are stretched or squeezed by a tiny amount (a fraction of a percent), taking over some of the work of the interword glue and giving a more uniform, tightly set paragraph.
Beyond those, the package also offers **interword-spacing adjustment, extra kerning, hyphenatable letterspacing (\textls{...}), and disabling ligatures. Which features are available depends on the engine. Protrusion works with pdfTeX, LuaTeX, and XeTeX; expansion works with pdfTeX and LuaTeX only** (not XeTeX); disabling ligatures works with pdfTeX and LuaTeX. The package enables by default only what can safely run on your engine, so loading it with no options is enough to start.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{microtype} % protrusion + expansion, on by default
\begin{document}
Long justified paragraphs look noticeably more even with microtype:
fewer rivers of white space, tidier right margins, and \textls{LETTERSPACED}
small caps when you ask for them.
\end{document}The adjustments are subtle — not obvious at a glance — but across a page they show up as fewer rivers of white space, evener line endings, and less hyphenation. For serious Western typesetting, adding microtype is effectively a standard move — a near-mandatory quality upgrade. And again, these effects apply to Western (Latin) text. Japanese has its own typesetting model, distinct from protrusion and expansion, handled by tools such as luatexja.