Graphics, Figures & Tables ⇒ Overfull Box with Margin Figures
-
- Posts: 12
- Joined: Mon Apr 15, 2013 6:28 pm
Overfull Box with Margin Figures
It's the old overfull \vbox problem again. I would like to understand how it works exactly. I have a figure that clearly does not violate the page margins but I'm still getting the 'overfull' error. I'm not sure whether these errors pertain to the figure/table itself or to the particular page. If the latter, I could see getting a underfull error in cases where a figure/graphic is placed on a particular page but nothing else. This would leave some space under-utilized. My guess is that, when compiling, Latex seeks to squeeze as much on a page as possible. It then probably chooses the figure and a paragraph of text to go onto the same page even though this would lead to a minor violation of the page margins (probably less severe than the respective underfull error when placing figure and paragraph onto different pages). So far, this is all conjecture. I don't want to go ahead and just ignore/disable the error message. Is there some type of due diligence process or set of rules to follow to prevent this error from happening? I place the figures in my doc as a float. Maybe therein lies a problem? Any insights are greatly appreciated
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Overfull Box with Margin Figures
\hbox
and \vbox
messages which mean similar but yet different things. Most cases are best explained with an actual example but I'd still like to give the explanation from the LaTeX Companion - or rather my translation from my German edition:-
Overfull \hbox (<number>pt too wide) <somewhere>
TeX was forced to create a horizontal box of a certain width (e.g. for a line in a paragraph or in a\makebox
command). However, it was not possible to reduce the material to the available space even after all available space has been shrinked as much as possible. This is why the present material will protrude into the margin. In most cases this is actually quite obvious even if it is only a little protrusion. This problem has to be solved manually since TeX was not able to solve it. -
Overfull \vbox (<number>pt too wide) <somewhere>
TeX should create a vertical box of a certain size (e.g. for a\parbox
command or a{minipage}
with a second optional argument) and found more material than fit in. The surplus material will protrude at the bottom of the box. It depends on the circumstances if this is a problem. -
Underfull \hbox (badness <number>) <somewhere>
TeX was forced to create a horizontal box of a certain width (e.g. for a line in a paragraph or in a\makebox
command). The available white space had to be stretched more than it should have been. This means the stretch was more than 100% of the sum of the availableplus
specifications. Internally this is expressed with a badness value of more than 100. A value of 800 means that the white space had to be stretched twice than the allowed amount.
If such an underfull box really is a recognizable problem possibly has to be checked visually in the document. With a badness value of10000
the box can look arbitrarily ugly. Since TeX's infinity value10000
is rather low it can happen that an extremely empty line was chosen although several not lines would have been possible that aren't filled well. In such a case the length parameter\emergencystretch
can be helpful.
Which badness value leads to a warning is determined by the integer parameter\hbadness
. In LaTeX it is set to1000
which means that only really bad boxes are warned of. In an important document one can test with an ambitious value like\hbadness=10
to see how many lines TeX thinks are not well-balanced.
By the way, since the warning is produced by TeX directly it always reports an\hbox
regardless of which box command has been used in the source. The place where the problem occurred is given with<somewhere>
and can be one of the following cases:-
detected at line <line number>
The problem is an explicitly created box that ends in the source in line<line number>
. For example this can be a\makebox
command with an explicit argument for the width. -
has occurred while \output is active
TeX was busy building a page and while it was adding headers and the like detected the problem. Since this process is asynchronous no line number is given. A check of the page next to the problem can show if one has to help manually. -
in alignment at lines <line numbers>
The box belongs to a{tabular}
or another aligned environment. The<line numbers>
give the position of the whole aligned structure in the source since TeX has no possibility to determine the exact place where the problem occurs. -
in paragraph at lines <line numbers>
The underfull box is a badly balanced line in the given<line numbers>
in the source.
-
-
Underfull \vbox (badness <number>) <somewhere>
TeX was forced to build a vertical box of a given height (e.g. for a\parbox
command or a{minipage}
environment). There the white space had to be stretched more than it should have been (see »underfull \hbox...
« explanations). With the command\vbadness=<value>
one can suppress all warnings for badness value below the given threshold. Then LaTeX only will warn of boxes with a higher badness value, default is1000
. The place where the problem occurred is given with<somewhere>
. This can be one of the following cases:-
detected at line <line number>
The box has been constructed explicitly (<line number>
refers to the end of the box) and inside the box there isn't enough stretchable space. The examplewould produce the warning since the box is supposed to be 4cm in height but there is no stretchable space likeCode: Select all
\parbox[c]{2in}[s]{4cm}{Test test}
\par\vfill
between the two words. -
has occurred while \output is active
In most cases white space on the present page had to be streched more than what LaTeX deemed acceptable. If this problem has visual effects depends on a lot of factors, for example which kind of white space is available on the page. A larger white space above a heading is less of a problem than list that has been stretched too much. It is recommended to check such pages manually. Often the commands\enlargethispage
and\pagebreak
are helpful.
If this problem occurs unusually often one should check if the parameters for lists, paragraphs or headings are too restricted. One should also check if the length parameter\textheight
corresponds to an integer multiple of text lines. -
in alignment at lines <line numbers>
In standard LaTeX this warning shouldn't occur. In special applications it can happen, though. In such a case one can find the source of the problem with<line numbers>
.
-

Regards
-
- Posts: 12
- Joined: Mon Apr 15, 2013 6:28 pm
Re: Overfull Box with Margin Figures
Overfull Box with Margin Figures
The I like to recommend the German version of the Companion, of course! While it is no beginner's book (unlike Stefan's Beginner's Guide) it is great for looking things up.fboehlandt wrote:I'm actually German
Regards