Article
Breaking paragraphs into lines
Article first published online: 27 OCT 2006
DOI: 10.1002/spe.4380111102
Copyright © 1981 John Wiley & Sons, Ltd
Additional Information
How to Cite
Knuth, D. E. and Plass, M. F. (1981), Breaking paragraphs into lines. Software: Practice and Experience, 11: 1119–1184. doi: 10.1002/spe.4380111102
Publication History
- Issue published online: 27 OCT 2006
- Article first published online: 27 OCT 2006
- Manuscript Revised: 6 FEB 1981
- Manuscript Received: 25 DEC 1980
Funded by
- Addison-Wesley Publishing Company
- Abstract
- References
- Cited By
Keywords:
- Typesetting;
- Composition;
- Line breaking;
- Justification;
- Dynamic programming;
- Word processing;
- Layout;
- Spacing;
- Box/glue/penalty algebra;
- Shortest paths;
- TEX (Tau Epsilon Chi);
- History of printing
Abstract
This paper discusses a new approach to the problem of dividing the text of a paragraph into lines of approximately equal length. Instead of simply making decisions one line at a time, the method considers the paragraph as a whole, so that the final appearance of a given line might be influenced by the text on succeeding lines. A system based on three simple primitive concepts called ‘boxes’, ‘glue’, and ‘penalties’ provides the ability to deal satisfactorily with a wide variety of typesetting problems in a unified framework, using a single algorithm that determines optimum breakpoints. The algorithm avoids backtracking by a judicious use of the techniques of dynamic programming. Extensive computational experience confirms that the approach is both efficient and effective in producing high-quality output. The paper concludes with a brief history of line-breaking methods, and an appendix presents a simplified algorithm that requires comparatively few resources.

1097-024X/asset/olbannerleft.jpg?v=1&s=2d7d001211f2c40f177a231141601e9f52afc1f3)
1097-024X/asset/olbannerright.jpg?v=1&s=3aec7891a8ba78b361ead9743adfc0b6eae6369a)
1097-024X/asset/cover.gif?v=1&s=5a70ecca2928358eca4ff75b9921d0552ffb6539)