Now I get a lot of overfull hboxes.
These occur mostly because of
1. a citation of the form [Zach00] hanging into the margin, or
2. words like "whether" which latex doesn't seem to want to hyphenate, or
3. in one case a subsection heading was just long enough so that its last
syllable was hanging into the margin, or
4. in-text math formulas like ${0,\ldots,3}^2$ .
From searching this NG i understand that I have the following options:
1. re-phrase the paragraph,
2. put \sloppy just before the paragraph,
(\sloppy affects only the immediately following paragraph, right?),
3. put \looseness=-1 or \looseness=1 just before the paragraph.
Now I would just like to learn whether or not I have any other,
maybe more permanent, options to resolve such overfull hboxes?
Any hints, suggestions, and insights will be highly appreciated,
Gab.
--
/---------------------------------------------------------------------\
| Paradigm is a word too often used by those |
| who would like to have a new idea |
| but cannot think of one. |
| (Mervyn King, Deputy Governor, Bank of England) |
| |
| za...@igd.fhg.de g...@gab.cx Gabriel....@gmx.net |
| www.igd.fhg.de/~zach/ www.gab.cx __@/' |
\---------------------------------------------------------------------/
> Recently, I reduced the texwidth of my LaTeX2e document (single column)
> in order to get closer to the 66 chars/line optimum.
>
> Now I get a lot of overfull hboxes.
The parameter you want to set is \tolerance. It indicates
how much stretching you will tolerate in a paragraph --
more than \tolerance and TeX gives up, gives an overfull
box, and lets you deal with it manually. \tolerance
is in units of "badness", not length, and anything
badder than 10000 is considered infinitely bad.
\sloppy sets \tolerance=9999, which may be just what you want
for your whole document (just put \sloppy once in the preamble).
TeX will run a little slower formatting paragraphs, but no
more overfull boxes. TeX will still warn you about lines
that are very stretched, so you can attend to those manually.
Otherwise, you can set a tolerance such as
\tolerance=800
in the preamble.
Donald Arseneau as...@triumf.ca
> 2. words like "whether" which latex doesn't seem to want to hyphenate, or
Hint the hyphenation: whe\-ther. Hope I got that right. :)
Cheers,
- Joel
> Donald Arseneau <as...@triumf.ca> writes:
>
> > The parameter you want to set is \tolerance.
>
> In the TeXbook, p. 107, Knuth seems to recommend \emergencystretch
> instead of \tolerance to avoid overfull hboxes:
I glossed over this. But \emergencystretch is not preferable; it is
a fall-back for when infinite tolerance would be required. The problem
is that Knuth isn't Cantor, and considers all "infinities" to be equal
Any paragraph that will work within a finite tolerance (<10000) will
work better that way than by using an insufficient tolerance and
\emergencystretch -- when TeX resorts to \emergencystretch it pays
less attention to the real glue on the line.
If you set an infinite tolerance, though, you get *Really* bad results
because TeX will make a very bad line much worse in order to achieve
trivial improvements on other lines.
really bad (10000)
just to make this line fit (0) = 10000
really bad just to (10000)
make this line fit (9500) = 19500
TeX would choose the first with \tolerance=10000.
\emergencystretch prevents the badness from seeming infinite (and
therefore always the same), so TeX will balance better, choosing
the numerically "worse" second example.
But a low tolerance plus \emergencystretch is not as good as a
high (finite) tolerance. An emergency pass will excessively
stretch lines with very little flexibility:
high emergencystretch:
emergencystretch tolerance
they do not work the same.
low emergencystretch:
emergencystretch tolerance they
do not work the same.
In fact, I simulate a stupid DTP line-filling algorithm by setting
\emergencystretch=\maxdimen
\tolerance=0 \pretolerance=0
LaTeX's \sloppy sets tolerance=9999 and \emergencystretch=3em.
Donald Arseneau as...@triumf.ca
> 2. words like "whether" which latex doesn't seem to want to hyphenate, or
If you check an English dictionary you will find that there is nothing
surprising about that, because the word "whether" is not normally
considered hyphenatable. So why would LaTeX "want" to hyphenate it? :-)
You can always override if you don't care what the dictionary says. Use
\hyphenation or \-.
would that make a difference?
I've got \hyphenation{whe-ther} already in the preamble,
but TeX still doesn't hyphenate it ...
TNX,
so, should I set \tolerance500 in the preambel,
or should I do something like
{ \tolerance 500
bla bla ..
}
for just those paragraphs where the overfull hbox occured?
> LaTeX's \sloppy sets tolerance=9999 and \emergencystretch=3em.
so, \sloppy produced actually a pretty bad layout?
TIA,
indeed, if I understand the online Webster right
( http://www.m-w.com/cgi-bin/dictionary?whether ),
then the *conjunction* whether cannot be hyphenated, but the *pronoun* can.
> considered hyphenatable. So why would LaTeX "want" to hyphenate it? :-)
just curious, how would LaTeX know that I meant the conjunction? ;-)
TNX,
> On 06 Dec 2000 04:08:51 -0800, Donald Arseneau <as...@triumf.ca> wrote:
> > Stefan Ulrich <ulr...@cis.uni-muenchen.de> writes:
> so, should I set \tolerance500 in the preambel,
> or should I do something like
> { \tolerance 500
> bla bla ..
> }
> for just those paragraphs where the overfull hbox occured?
Especially for something as low as 500 I would set it in the
preamble. Trying to delimit the scope is bound to cause
accidents, like putting the "}" before the \par ( = blank line).
> > LaTeX's \sloppy sets tolerance=9999 and \emergencystretch=3em.
>
> so, \sloppy produced actually a pretty bad layout?
No, it is very good; about as good as you can get. It has a
very high but finite tolerance, plus some moderate emergency
stretch. What I was getting at was it doesn't make sense to
set an emergency stretch until you have `used up' all the
finite tolerance (up to 9999). I would just put \sloppy in
the preamble. The speed penalty is not bad.
Does anybody else think LaTeX's [draft] option has it backwards?
When I am doing drafts I want the typesetting to be fast, but
I don't mind some overfull boxes. But when I am making a final
copy there is no way I'll accept overfull lines!
Donald Arseneau as...@triumf.ca
> indeed, if I understand the online Webster right
> ( http://www.m-w.com/cgi-bin/dictionary?whether ),
> then the *conjunction* whether cannot be hyphenated, but the *pronoun*
> can.
Aha, most interesting!
> > considered hyphenatable. So why would LaTeX "want" to hyphenate it? :-)
>
> just curious, how would LaTeX know that I meant the conjunction? ;-)
That is a good point. There are other words, of course, where the
hyphenation differs depending on the usage: pres-ent versus pre-sent and
so on. And of course LaTeX will not know which one you mean unless
you specify. Probably by defining a command for the variant that you use
less often:
\newcommand{\whether}{wheth\-er\xspace}
Then all you have to decide is whether you want this \whether or that
whether whenever you use it.
The online OED raises the further questions:
what about the adjective? the adverb?
--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. www.wischik.com/lu
> Does anybody else think LaTeX's [draft] option has it backwards?
ah yes, it is more a `proof' option, than a draft one (but some
packages like graphics really mean draft...), \sloppy is
better fitted to drafts