# [XeTeX] Line-breaking algorithms in XeTeX

Tue Apr 28 18:37:27 CEST 2009

```On 28 Apr 2009, at 09:16, John Was wrote:

> One thing I've learnt from your sample, though, is that (Xe)TeX
> selects
> different hyphenation and line-breaking points when the \looseness is
> reduced to -1, even though that doesn't in fact produce a smaller
> number of
> lines.  I had always assumed that if the line-count ends up the same
> as if
> \loosness were 0, then the \looseness-1 would be ignored without
> causing any
> effect at all.

Yes, this can seem surprising at times; actually, it's even possible
for \looseness=-1 to result in the paragraph being set slightly
*looser* (with more text on the last line), if it can't fit into fewer
lines.

One reason this happens, I believe, is that without \looseness,
(Xe)TeX may have been setting the paragraph successfully on its first-
pass attempt, without doing any hyphenation, whereas adding the
\looseness command triggers the hyphenation pass, and then (even if
the line count ends up the same) a different set of breaks may be
chosen, depending on the badness of the resulting lines, compatibility