share
TeX - LaTeXhow to suppress "Underfull \vbox (badness 10000) ... while \output is active"?
[+73] [3] barbara beeton
[2012-07-05 14:03:07]
[ page-breaking warnings primitives ]
[ https://tex.stackexchange.com/questions/62296/how-to-suppress-underfull-vbox-badness-10000-while-output-is-active ]

when using an inflexible document class, one is often faced with the warning

Underfull \vbox (badness 10000) has occurred while \output is active []

on pages that contain no display math.

in underfull \vbox [1] frank mittelbach quotes from the companion (2ed) regarding page specs that are "too rigid". the recommended (and obvious) approach is to build in more flexibility.

the same suggestions, to add flexibility, are given in What are underfull hboxes and vboxes and how can I get rid of them? [2].

the document class in question was constructed (intentionally, if short-sightedly) with no allowance for stretch in the \parskip, between chapter title and text, and in a few other locations. furthermore, an option permits the change from [10pt] to [11pt] body text so even if the \textheight is an integral number of lines in one size, another size will not meet the criterion.

with \vfuzz one can specify a small allowance which, if not exceeded, will suppress overfull box messages. but there isn't any equivalent for a negative allowance.

i've checked the etex manual (the latest, dated 1998/03/04) and that for etextools but didn't find anything useful. i've looked into the tex.web code, but it wasn't obvious how one might work around the problem without a new primitive.

it's not a good idea to ignore these messages in the log, since the "structural" ones camouflage the ones (usually very few) that do need to be attended to. has anyone come up with a method for suppressing only those underfull vbox messages that are off by only a couple of points?

(11) The amsart class is known for this "feature". :) - egreg
I guess if you want to suppress one particular type of vbox warning you could use the silence package. - Jörg
(1) @egreg -- that's what i meant by "intentional but short-sighted". sigh. - barbara beeton
(1) I think that MWE would help... - yo'
@jorg -- two problems: (1) this is a tex warning, not a latex one; (2) can you think of a way to discriminate between a vbox underfull by only 2 points vs. one underfull by 2 inches? - barbara beeton
Then silence does not help, I guess. I was thinking about overfull/underfull warnings, then silence would work (sorry, I accidentally posted this as an answer...) - Jörg
The underful pages (if there is no stretch on the page) will leave the page short so it seems you are saying that you don't mind it being up to 2pt short so isn't the thing to do to use a variant of raggedbottom that adds 0pt plus 2pt glue to the bottom of each page rather than fil glue? - David Carlisle
@DavidCarlisle -- the \raggedbottom observation seems promising. yes, a page is definitely allowed to be 2pt short under the action of the current specs. but plus 2pt of glue can expand to quite a bit more under some situations, so this does need to be examined carefully. - barbara beeton
[+28] [2012-07-05 16:09:09] David Carlisle [ACCEPTED]

Adding a finite stretch on the page suppresses warnings so long as the shortfall is within this limit, so at 11pt 1pt suppresses the warning completely .7pt makes it have a "non infinite" badness and anything much less than that has infinite badness.

\documentclass[11pt]{amsart}

\makeatletter
 \def\@textbottom{\vskip \z@ \@plus 1pt}
 \let\@texttop\relax
\makeatother

\begin{document}

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

aa\\bb\\cc\\dd\\ee\\ff\\gg

\end{document}

Does it move the footer? - yo'
add a few more lines, please, david. this method avoids the "overfull 10000" on the first page, but it will happen on page 2 because of the misfortune that \widowpenalty pulls an extra line over to page 3. but it's headed in the right direction. and adding a title, author, and a footnote or two for the top matter is good on the first page (which will always be true for amsart since there's stretch with the footnote rule; now to try it with amsbook). - barbara beeton
(1) ah OK so I repeated stuff so there were 8 pages, and had to make the stretch 7pt to have no warnings. principle is the same though:-) - David Carlisle
(1) @tohecz the definition is exactly the same as \raggedbottom (I just cut and pasted it from latex.ltx) except changing the glue stretch to a finite amount. - David Carlisle
@DavidCarlisle -- thanks for the info that increasing the stretch to 7pt will "disappear" the warning messages. it gives me a good basis for further experimentation, and a reasonable approach to suggest to an author who is currently bedeviled with a superabundance of overfull vbox messages. - barbara beeton
(1) @DavidCarlisle -- i'm upvoting because this provides an acceptable workaround for the situation under consideration. (it turns out that, for the particular class involved, a stretch of 5pt is necessary to reduce 10000 to something ignorable, and 9pt is needed to "disappear" the warnings entirely.) i'll wait a decent interval (so see if any superior approach shows up) before accepting. - barbara beeton
What about when amsart is not used? And is this considered a good solution (why?) or a dirty workaround? - sigvaldm
(2) @sigvaldm it's not specific to amsart at all, it just uses core latex functionality. Clearly all my answers are good solutions not dirty workarounds:-) Well more seriously it's a good solution if you are happy with what ot specifies, that the bottom line is "near" the bottom of the page. If you used \flushbottom and really wanted that then of course this is no help at all. - David Carlisle
1
[+7] [2012-07-05 15:49:09] egreg

There is no "negative \vfuzz". The only way I see is patching the output routine to measure the actual height of the page to be output and, if the difference with the desired height is less than a threshold value, issuing \vbadness10000 when the box is actually built.

Using \raggedbottom is not an option, I believe, because it can introduce variability that perhaps is difficult to control.

A patch to amsart.cls that seems to work, in the direction of not having underfull pages, is

\textheight=\dimexpr
  \ifcase\@mainsize
    \or % 0
    \or % 1
    \or % 2
    \or % 3
    \or % 4
    \or % 5
    \or % 6
    \or % 7
    57\or % 8
    52\or % 9
    48\or % 10
    44\or % 11
    41\fi % 12
  \baselineskip+\topskip\relax

instead of setting \textheight=584pt for all sizes. This gives the following values for \textheight:

580pt (8pt size)
582pt (9pt size)
586pt (10pt size)
582pt (11pt size)
584pt (12pt size)

It's probably similar for amsbook.

Of course this would break many existing documents. A difference of two points for the main sizes with respect to the "ideal" height is not noticeable. Of course all the objects that add unstretchable or unshrinkable spaces should occupy an integer number of lines.


(1) of course two points one way or the other isn't noticeable to the human eye, but "the rules are the rules" according to management, and the tight specs applied when a pdf image is imposed onto a printing plate could result in something being cut off unless the positioning "window" is adjusted. (and all ams document classes are inflicted with this feature, as you suspect.) i'll pursue this idea though. thanks. - barbara beeton
2
[+3] [2012-07-05 15:53:32] yo'

One option is to modify output routine so that it includes \vspace with some plus at the very end:

\documentclass[a4paper]{amsart}
\usepackage{lipsum}
\usepackage{showframe}

% fixed text size so that paper size has no influence.
\setlength{\textheight}{545pt}
\setlength{\textwidth}{350pt}

\begin{document}

% adjust some lengths to invoke the problem
\parskip0pt
\baselineskip30pt

% this, put at the beginning of the document, solves the problem
% adjust the `plus` part of the `\vspace` to your faviourite value
\makeatletter
\edef\orig@output{\the\output}
\output{\setbox\@cclv\vbox{\unvbox\@cclv\vspace{0pt plus 20pt}}\orig@output}
\makeatother

% the warnings for the pages that are actually full have disappeared
\lipsum

% these `\vbox`es are really short and the warning is there
\vbox{\lipsum[1]}\par
\vbox{\lipsum[1]}\par
\vbox{\lipsum[1]}\par
\vbox{\lipsum[1]}\par

\end{document}

The warnings for pages 2 and 4 are correct, since on page 2, one line is missing because of the widow elimination.


(1) this results in 7 pages. every page after page 1 is too short by our standards (excepting the last page, of course). with plus 30pt, only pages 5 and 6 were reported as underfull; changing that to plus 5pt added page 4, but this isn't adequate. - barbara beeton
With no vertical stretch, the pages cannot be not too short - yo'
the problem is that there are too few lines set on all pages but the first because of the \vboxes. a copyeditor seeing those pages would send them back to the author to be rewritten, or at least unboxed. - barbara beeton
Sorry, I did put \setlength{\textheight}{500pt} at a wrong place. I modified the example a bit, see the update. - yo'
I'm still getting the same Underfull \vbox (badness 10000) error. - skan
3