Typesetting glue represents adjustable space between pieces of typeset material. In a finite, single-order model, describe a glue item by a nominal width , stretch coefficient and shrink coefficient . A shared line adjustment ratio givesThus a negative reduces the gap. The coefficients describe relative flexibility; they need not be identical for all spaces. This model is a useful part of text justification.[ref]
Breaking paragraphs into lines by Donald E. Knuth and Michael F. Plass. pp.1123–1127: glue widths, stretch, shrink and adjustment ratios
For example, two nominal gaps of width 3 with stretch coefficients 1 and 3 become and when . Their total extra width is 2. With shrink coefficients 1 and 1, makes both gaps width 2. The same natural line can therefore reach different targets by using the appropriate coefficients.
Proportional stretching and shrinking of typesetting glue
. Original finite-glue example: boxes of widths 8,6,10; two gaps with nominal width 3, stretch coefficients 1 and 3, and shrink coefficients 1 each. The generator computes the adjustment ratios and resulting widths. Details.TeX also distinguishes typesetting glue orders, so the finite model above does not describe every glue setting. In a horizontal line, typesetting glue changes gaps rather than stretching the outlines of the glyphs.
A typesetting glue order assigns a priority to stretch or shrink in TeX. The orders are normal finite flexibility,
fil, fill and filll, in increasing priority. With nonnegative coefficients, the highest present order absorbs the adjustment; lower-order flexibility is left unused.[ref]TeX source code by Donald E. Knuth. glue_spec fields and hpack/vpack: highest nonzero order for glue setting
For example, suppose a line has natural width 22 and must reach width 34. Two zero-width glue items have stretch coefficients
1fil and 2fil. Their added widths areA finite-order glue item in the same line keeps its nominal width during this adjustment. The symbols define priorities for distributing a finite width difference. Within the selected order, the coefficients still determine proportional sharing.The simple finite model in typesetting glue uses only the normal order. Higher orders make it possible to place flexible space at selected locations, such as before or after a line's content, without requiring the ordinary word spacing to absorb that particular adjustment.
Articles by others on the same topic
There are currently no matching articles.
