Open FrankMittelbach opened 5 years ago
Any comment concerning this and #32?
@FrankMittelbach — Sorry, I did look at this briefly over summer but didn't have proper time to sort out a fix. With #32 when you say "back up" over a vertical skip, you mean just add negative vskip for the sizes needed, right?
right. \addpenalty
and friends store lastskip then back up (\vskip-\lastskip
) then do what they do then readd the space so that their action appear as if done on that earlier point.
After skipping ahead with
\vskip 0 plus requested space
it issues \penalty -100
This means that this breakpoint is usually preferable to filling the requested space with normal text (as that will generate a breakpoint with 0 (or higher)).
If the needed space is exactly available, then the badness of the page page will be at most 100 (and probably less) thus it becomes a bonus to break at this point.
Thus the penalty should be positive (probably something like 100 or perhaps even more).
Concerning \prevdepth: the skipping ahead without taking it into account first time may be ok as that is only a stretch amount, but when doing a real skip it should be substracted. Otherwise: if there are still exactly 3 lines left and we ask for 3 lines the skip will make the page overfull if \prevdepth is non-zero. E.g., something like
The advantage of subtracting it only at the later point is that we don't have to worry that \prevdepth really exists as we know by then that we are in vertical mode. The above doesn't contain a fix for #32