= Text justification
\b[Text justification] adjusts the contents of a line to occupy its available <typesetting line width>, often aligning both ends of the text. Changing <word spacing> is one method; permissible adjustments depend on the writing system. <Typographic alignment> more generally includes leaving the opposite edge ragged or centring a line.<CSS Text Module Level 3 by World Wide Web Consortium>[§6: alignment versus justification; §6.4: script-sensitive expansion and compression]{ref}
In an illustrative line with <natural line width> $N=30$ and target width $W=32$, two equally flexible spaces can each gain 1. If their stretch coefficients are instead 1 and 3, proportional adjustment allocates the required extra 2 as
$$
\boxed{\Delta_1=\frac{1}{1+3}\,2=\frac12,\qquad
\Delta_2=\frac{3}{1+3}\,2=\frac32.}
$$
Both choices reach the same width; their internal spacing differs. <Typesetting glue> expresses that flexibility, and the <line adjustment ratio> computes the common proportional change.
<Line breaking> and <text justification> interact: a different break changes the number of spaces available to absorb the width difference. A good paragraph layout therefore considers spacing quality when choosing breaks, rather than merely stretching an already chosen set of lines. The <Knuth-Plass line-breaking algorithm> makes that interaction explicit.
Back to article page