Discussion:
Overfull and Underfull \hbox errors
(too old to reply)
m***@gmail.com
2006-01-15 19:38:26 UTC
Permalink
I'm not doing anything fancy in LaTeX but I'm getting these "Overfull
\hbox" errors. Sometimes they say that xx.xxpt is too wide in a certain
paragraph, and the text extends past the margins, or it gives me an
Underfull error reporting "(badness 10000)", which is significantly
badassness, but irritating. The underfull errors don't appear to give
any noticeable formatting glitches in the output pdf file.

I realize I can manually break the line to remove the overfull error,
but that seems unnatural. And I have no idea what the underfull errors
are for.

Thanks for any help.
José Carlos Santos
2006-01-15 20:02:16 UTC
Permalink
Post by m***@gmail.com
I'm not doing anything fancy in LaTeX but I'm getting these "Overfull
\hbox" errors. Sometimes they say that xx.xxpt is too wide in a certain
paragraph, and the text extends past the margins, or it gives me an
Underfull error reporting "(badness 10000)", which is significantly
badassness, but irritating. The underfull errors don't appear to give
any noticeable formatting glitches in the output pdf file.
Are you using accents? Then you should use T1-encoded fonts.
Post by m***@gmail.com
I realize I can manually break the line to remove the overfull error,
but that seems unnatural. And I have no idea what the underfull errors
are for.
I do not have enough information to give you specific suggestions, but
you can always add

\tolerance 1414
\hbadness 1414
\emergencystretch 1.5em
\hfuzz 0.3pt
\widowpenalty=10000
\vfuzz \hfuzz
\raggedbottom

to the preamble of your document. I'm taking these values from:

http://groups.google.com/group/de.comp.text.tex/msg/c375ef11e78e7bfa?as_umsgid=a84us0$plqcm$***@ID-30533.news.dfncis.de

Best regards,

Jose Carlos Santos
m***@gmail.com
2006-01-16 00:01:16 UTC
Permalink
Post by José Carlos Santos
I do not have enough information to give you specific suggestions, but
you can always add
\tolerance 1414
\hbadness 1414
\emergencystretch 1.5em
\hfuzz 0.3pt
\widowpenalty=10000
\vfuzz \hfuzz
\raggedbottom
to the preamble of your document.
Thank you. I tried only the \emergencystretch command and it fixed the
Overfull error by hyphenating the last word of the line to continue
onto the next line. The other settings applied individually and
together had no affect on the Underfull errors.
Post by José Carlos Santos
There can be many contributory reasons, but the net effect in normal LR
setting is that an overfull \hbox means that there is a hyphenation or
justification problem: moving the last word on the line to the next line
would make the spaces in the line wider than the current limit; keeping
the word on the line would make the spaces smaller than the current
limit, so the word is left on the line, but with the minimum allowed
space between words, and the warning is given so that you can find the
line and fix it.
An underfull \hbox in the same circumstances means the reverse: adding
another word to the line would make the spaces in the line smaller than
the current limit; moving the word to the next line would make the
spaces larger than the current limit, so the word is moved to the next
line and the line is spaced out, and the warning is given so that you
can find the line and fix it.
(This isn't the whole of it, but it's enough for the moment.)
There are lots of ways to handle this. Some people inevitably ask "why
doesn't [La]TeX 'just do it right' by itself, like [wordprocessor]?" If
you examine the output of most other systems, they have fudged the issue
by making the wordspace far too wide or narrow on these occasions, or
even resorting to unpleasant letter-spacing. In almost all cases the
output is markedly inferior to [La]TeX's.
1. if it's your own text, reword it slightly;
2. set \spaceskip to the width of a lower-case e, variable by going as
narrow as the width of a lower-case i, or as wide as a lower-case m.
These values were given to me by an old hot-metal compositor: I don't
know how useful they are for digital type. It's usually A Bad Idea to
meddle with the type-designer's settings for word-spacing, if any,
but it may be needed for particularly narrow settings relative to the
type size;
3. make changes to the hyphenation so that the paragraph breaks
differently;
4. manually break the line where the error occurs (this is usually a
mistake in a long document if you are revising it, as you will almost
certainly reword some of it at some stage, and then the manual break
won't be needed);
5. change the typeface or size (usually not a realistic option though).
Thanks for the thorough explanation.
Curtis R Anderson
2006-01-16 03:29:14 UTC
Permalink
Post by José Carlos Santos
I do not have enough information to give you specific suggestions, but
you can always add
\tolerance 1414
\hbadness 1414
\emergencystretch 1.5em
\hfuzz 0.3pt
\widowpenalty=10000
\vfuzz \hfuzz
\raggedbottom
You can do this, but it will make the whole document look a bit raggedly
typeset. Instead, I would wait until you are absolutely sure that you
are finished formatting the document, then I would look for paragraphs
with overfull hboxes and enclose each paragraph with:

{ \sloppy
<contents of paragraph>
}

That's just the way I have done it once.
--
Curtis R. Anderson, Co-creator of "Gleepy the Hen", displaced
"In Heaven there is no beer / That's why we drink it here ..."
http://www.gleepy.net/ ICQ: 50137888
mailto:***@intelligencia.com Yahoo!: gleepythehen
Peter Flynn
2006-01-15 22:19:35 UTC
Permalink
Post by m***@gmail.com
I'm not doing anything fancy in LaTeX but I'm getting these "Overfull
\hbox" errors. Sometimes they say that xx.xxpt is too wide in a certain
paragraph, and the text extends past the margins, or it gives me an
Underfull error reporting "(badness 10000)", which is significantly
badassness, but irritating. The underfull errors don't appear to give
any noticeable formatting glitches in the output pdf file.
I realize I can manually break the line to remove the overfull error,
but that seems unnatural. And I have no idea what the underfull errors
are for.
There can be many contributory reasons, but the net effect in normal LR
setting is that an overfull \hbox means that there is a hyphenation or
justification problem: moving the last word on the line to the next line
would make the spaces in the line wider than the current limit; keeping
the word on the line would make the spaces smaller than the current
limit, so the word is left on the line, but with the minimum allowed
space between words, and the warning is given so that you can find the
line and fix it.

An underfull \hbox in the same circumstances means the reverse: adding
another word to the line would make the spaces in the line smaller than
the current limit; moving the word to the next line would make the
spaces larger than the current limit, so the word is moved to the next
line and the line is spaced out, and the warning is given so that you
can find the line and fix it.

(This isn't the whole of it, but it's enough for the moment.)

There are lots of ways to handle this. Some people inevitably ask "why
doesn't [La]TeX 'just do it right' by itself, like [wordprocessor]?" If
you examine the output of most other systems, they have fudged the issue
by making the wordspace far too wide or narrow on these occasions, or
even resorting to unpleasant letter-spacing. In almost all cases the
output is markedly inferior to [La]TeX's.

José Carlos has already posted some solutions; other possibilities are:

1. if it's your own text, reword it slightly;

2. set \spaceskip to the width of a lower-case e, variable by going as
narrow as the width of a lower-case i, or as wide as a lower-case m.
These values were given to me by an old hot-metal compositor: I don't
know how useful they are for digital type. It's usually A Bad Idea to
meddle with the type-designer's settings for word-spacing, if any,
but it may be needed for particularly narrow settings relative to the
type size;

3. make changes to the hyphenation so that the paragraph breaks
differently;

4. manually break the line where the error occurs (this is usually a
mistake in a long document if you are revising it, as you will almost
certainly reword some of it at some stage, and then the manual break
won't be needed);

5. change the typeface or size (usually not a realistic option though).

///Peter
Ulrike Fischer
2006-01-16 09:24:22 UTC
Permalink
Post by m***@gmail.com
And I have no idea what the underfull errors
are for.
underfull warnings (they are not errors) happens mostly when you are
using explicitly or implicitly boxes that can't be filled correctly:

\documentclass[10pt]{article}
\begin{document}
\parbox{3.5cm}{ a texttest testtest testtest test }
\end{document}

You will have to find the box/command first before someone can help you
to decide what to do.
--
Ulrike Fischer
e-mail: zusätzlich meinen Vornamen vor dem @ einfügen.
e-mail: add my first name between the news and the @.
Continue reading on narkive:
Search results for 'Overfull and Underfull \hbox errors' (Questions and Answers)
3
replies
What do "bad box(es)" mean in the LaTeX Results?
started 2007-08-11 10:20:15 UTC
mathematics
Loading...