Andreas L Delmelle wrote:
Just wondering about some KnuthSequences for spaces I noticed during
a debug-session:
glue w=0 stretch=10008 shrink=0
penalty w=0 p=0
glue w=3336 stretch=-10008 shrink=0
What does it mean that the latter glue can be stretched by a negative
amount?
Why not:
glue w=3336 stretch=0 shrink=10008
Is there a difference as to how the algorithm treats these?
Negative stretch is not the same as a positive shrink (and vice-versa): a
negative stretch is used to cancel (or diminish) a positive one provided
by some other elements: for each possible break point, however, the
overall stretch / shrink should always be >= 0.
The meaning of the mini-sequence above is:
- if there is a break at the penalty element, there is some stretch for
the line ending there
- otherwise, the overall stretch is zero
This is with unjustified text to give each line the same amount of
stretch, so that the algorithm should build lines with similar length
(while in justified text a line with many spaces and few letters could be
stretched a lot).
HTH
Luca