On Thu, Mar 27, 2014, James K. Lowden wrote: > On Thu, 27 Mar 2014 19:29:13 -0400 > Peter Schaffter <pe...@schaffter.ca> wrote: > > > Would it not make more sense to have groff, more or less as-is, > > shoulder more of the burden of what we do manually, *using the same > > strategies*, to achieve better *lines*, rather than focussing on > > the whole paragraph? > > This is an excellent idea. Your key insight is that what you do by hand > could be automated with very little impact on the overall system, to > useful effect. I doubt it's been fully explore because the problem of > "how to set a paragraph" is considered solved, by TeX. > > It occurs to me that an algorithm that aims only at a better line -- for > some value of "better" -- is at a disadvantage versus the > paragraph-at-once approach. In considering a line, a per-line > algorithm cannot steal letters from the previous line, the one already > set. The best it can do is pack more letters on the current line. > > That might be OK. It's what you do (IIUC) manually, because too much > whitespace is the major bugaboo. > > It also might be improved by a lookahead rule: rather than looking > strictly at the current line, consider the potential impact on the next > one, and perhaps "donate" a character or two to the line yet to come.
You seem to see where I'm headed with this. After a line is output, groff has a buffer holding the next partially-filled line, and the way I'm thinking, this could be put to use. It's going to take a day or two to work out a fuller description what I'm thinking. -- Peter Schaffter http://www.schaffter.ca