I've tried to make some sense on the last discussions on rebreaking, did
some experimaentations with 1.3.x, and still I don't see a clear path.

First of all, let me say on the positive side that I think that once a
reasonable behaviour is decided it won't be too hard to implement it. The
current rebreaking scheme is far from perfect, but has a clear rationale
and is understandable (thanks to andre as always of course).

The problem consists in text insets that decide their size in base of
external and internal constrains.

Let's take first minipage. In 1.3.x, setting a minipage to P%{col,text}
gives an on-screen representation of P% of the textwidth, *except* when the
minipage is in the first position of a paragraph, in which case it gives 
min(P% textwidth, textwidth - indent) (obviously, this mechanism enter only
when the indent is > 0 and P is rather large, and/or the workarea is small.
For instance, always for indent > 0 and P=100). Keeping 1.3.x behaviour
implies IMHO to have this kind of special casing. One ugly consequence of
this special casing is that on an indented line, normally say 90%col and
100%col don't make any visual difference. Another one is that it doesn't
give any warning about what will be a broken result.

Latex, obviously, just does P% of the textwidth/colwidth (making the inset
overflow to the right), just like current cvs. 

Now let's go to 'natural width' insets. We didn't have those in 1.3.x.
John's proposal seems to be to pass them both the textwidth and the
remaining space on the row the inset starts in, an let the inset decide its
width based on that. Although this give us a bit more flexibility,
unfortunately it is still not clear what does the inset will decide (and
John subbornly refused to explain :-P): suppose we are in this situation:
                    <---- s --------->
blah blah blah blah [open inset] blah 
<--------------- w ------------------>

where [open inset] is an inset that has yet to decide his size (and he is
full of text). We pass him (w,s). THere are several options: 1) he tries to
use s and disregard w:

                    <---- s --------->
blah blah blah blah [open inset]      
                    +----------------+
                    |                |
                    |                |

                    |                |

                    +----------------+
blah blah blah blah blah blah blah blah 
blah blah blah blah blah blah blah blah 
blah blah blah blah blah blah blah blah 

not very optimal, as this uses a lot of unneeded vertical space. (in this
case, I think that display() behaviour is preferable)

option 2) he uses only w -> we get current cvs behaviour
option 3) use a mixture of the two, choosing the one that spans less
vertical space (the inlined version uses a line less, but then has less
horizontal space to accomodate the remaining rows and so there will be
probably more of them). Probably option 3) is better, but I'm not sure.
Implementing 1) or 3) wouldn't be very hard, only we have to put the
metrics calls for childrens inside the rebreak loop (again, because andre
made some work to take it out...). A bit messier than the current scheme
(make all children metrics call as a first thing in it's own metrics call)
but not terrible.

Now what happens if we have the inset in the first char of an indented line?

           <----------- s ----------->
           [open inset] blah blah blah
<--- i --->
<--------------- w ------------------>


1) doesn't have any problem with this, 2) and 3) have the very same problem
as with minipages. I repeat, making a special casing for the first char of
an indented line is messy and ugly, but I don't see many options. 1.3.x
didn't have this problem as for instance a float is just display()ed and so
/completely disregards/ indent. Latex does the same for instance with a
'here, definitely' float. 

Any /constructive/ comment is welcomed.

Alfredo


Reply via email to