On Sun, Dec 18, 2005 at 11:10:37AM +0100, Andreas L Delmelle wrote: > On Dec 18, 2005, at 06:16, Manuel Mall wrote: > >Does it mean because the Knuth algorithm removes all glues after a > >linebreak (and we also remove all glues at the end of a paragraph) a > >nbsp should not be modelled not like this: > > > > pen p=INF > > glue w=... > > > >but like this: > > > > box w=0 aux=true > > pen p=INF > > glue w=... > > box w=0 aux=true > > > >with the leading box preventing removal at the beginning of a line, > >the > >trailing box prevents removal at the end of a paragraph, and the > >penalty prevents a line break. > > As far as my understanding of the Knuth algorithm goes, that might be > a way to solve it. Even better would be to make the creation of the > auxiliary zero-width boxes conditional --depending on whether there > are already other boxes surrounding the nbsp (if at all possible). > It's really only in the cases where there are no preceding/following > boxes that we need special treatment, no? In case of surrounding non- > whitespace, the first model would seem to be sufficient.
That is indeed the way to solve it. The more I think about this, the more complicated it becomes. Maybe the Knuth algorithm requires that when there are multiple characters which are suppressed at linebreak, they are considered together, much like we do in space resolution in page breaking. One should avoid the situation glue - glue, if the first glue is to be suppressed when the second glue is a chosen line break. It should be a single glue, or a sequence like glue #1 - penalty - glue #2 - box - PENALTY - glue #3 if glue #1 and glue #3, i.e. the glues that remain around a line break, are not zero. Simon -- Simon Pepping home page: http://www.leverkruid.nl