Knuth–Plass line-breaking algorithm
Appearance
The Knuth-Plass algorithm is a line-breaking algorithm designed for use in Donald Knuth's typesetting program TeX. It integrates the problems of text justification and hyphenation into a single algorithm by using a discrete dynamic programming method to minimize a loss function that attempts to describe the aesthetic qualities desired in the finished output.[1][2][3]
The algorithm works by dividing the text into a stream of three kinds of objects: boxes, which are non-resizable chunks of content, glue, which are flexible, resizeable elements, and penalties, which represent places where breaking is undersirable (or, if negative, desirable).[2]
References
- ^ "The Knuth/Plass line-breaking Algorithm". defoe.sourceforge.net. The Folio Project. Retrieved 2024-03-30.
- ^ a b Knuth, Donald E.; Plass, Michael. "Breaking Paragraphs into Lines" (PDF).
- ^ Jonathan, Fine (2000). "Line breaking and page breaking" (PDF). TUGboat.
External links
- Breaking Paragraphs into Lines, the original paper by Knuth and Plass