On the power of traps and diversions in a document preparation language

This note illustrates the power of software interrupts (traps) and text diversions in document preparation languages by considering three difficult problems in typesetting: figure placement; setting text in arbitrary shapes; and balancing final columns in multi‐column layout. The solution of each of these in the nroff document preparation system is discussed, and an Appendix gives the nroff macros which accomplish the tasks.