The following is written in the context of typesetting a primarily continuous-prose work such as a novel.
Some time ago, Steve Izma eloquently posted (http://lists.gnu.org/archive/html/groff/2004-03/msg00091.html) on why orphans are fine and widows should be eliminated. Indeed, the modern typesetting world follows this principle: in the sampling of novels I examined, orphans appeared regularly but widows not at all. Steve's post also lays out some options for eliminating widows. His method at the time was to re-kern a previous paragraph in such a way that it ends up being typeset one line shorter or longer, either of which would eliminate a widow on the next page. This method has the distinct advantage that, if done right, it leaves no visible trace to the reader that anything has been altered. Its drawback, of course, is that it must be done manually on a case-by-case basis; there is no way to automate something like this. I would like to explore methods that can be automated while preserving other typesetting principles, particularly the principle that the bottom lines on every pair of facing pages should align. This was true of every book I looked at. In groff, it is easy to automate the prevention of orphans (using .ne, which is written into some macro packages' paragraphing macros); widows are harder, but a few techniques have been put forth on this list over the years. However, a common feature of all these techniques -- for both widows and orphans -- is that their effect is purely localized, moving a line from the bottom of one page to the top of the next. None of these methods preserves bottom-line alignment with the facing page. In professionally typeset novels, when a page is shortened by one line to eliminate a widow on the following page, bottom-line alignment is handled in one of two ways (at least, in the novels where I've been able to figure out their trick): - the leading (aka line spacing) of the page is increased slightly, or - the facing page (whether preceding or following) is also shortened by one line. The challenge to automating either of these techniques in groff, of course, is that often by the time you know the alteration has to be done, the page to be altered has already been generated. So any automated technique would have to involve two passes. I have some ideas on how such a two-pass system might be implemented, but before I start hacking, I'd like to make sure I'm not reinventing a wheel someone else has already perfected. Does a groff solution for this exist out there in Internet-land?
