[texhax] hypenation matters, again

Ian.Collier at comlab.ox.ac.uk Ian.Collier at comlab.ox.ac.uk
Thu Aug 19 00:00:28 CEST 2004

bnb at ams.org (Barbara Beeton) wrote in texhax:
>    bnb at ams.org (Barbara Beeton) writes:
>    >and setting the \...hyphenmin's to "infinity" may be
>    >a more efficient way to suppress hyphenation altogether
>    >than setting the \...hyphenpenalty values.
[I wrote:]
>    Surely one sets \pretolerance to infinity if one wants to
>    suppress hyphenation?

>well, that's one way of doing it, but it results
>in more passes through the text.

I disagree.

TeX makes up to three passes through the text: one with the tolerance
set to \pretolerance and no hyphenation, one with normal tolerance
and hyphenation, and one with \emergencystretch added to the glue.
The first of these passes is the quickest because it avoids all the
complications of hyphenation, and it is always performed although it
can be aborted early if a line is found with no feasible breakpoints.
The third pass isn't used in normal circumstances.

Setting \pretolerance to infinity makes the first pass succeed and
thus cuts out the second and third passes altogether.  However, it
does increase the number of feasible breakpoints per line which TeX
has to consider, and it's for this reason that this pass makes TeX
work harder than it does for the second pass in the special case
where none (or few) of the words admit hyphenations.  It turns out
in the particular configuration upon which I have tested it that
the \lefthyphenmin method is up to 10% faster than the \pretolerance
method and uses slightly less memory.  But there's a price: because the
tolerance is lower, TeX will tend to set lots of overfull \hboxes on the
more difficult paragraphs.  To fix this, you can raise the tolerance -
but this removes the advantage!
---- Ian Collier : imc at comlab.ox.ac.uk : WWW page below
------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml

More information about the texhax mailing list