Underfull \vbox in each longtable… can it be fixed or must it be ignored?

I got some strange "underfull \vbox (badness 10000) detected at line ..." warnings, obviously at each of my "longtable"s. Is there a way to fix them (I actually don't see the cause) or do I have to ignore them?

Minimal working example (PdfLaTeX tells these warnings triply for each run on compiling with longtable [2000/10/22 v4.10 Multi-page Table package (DPC)]; each \demounderfullvbox might be replaced by the full example code or the source may be reduced to one longtable, what doesn't change behavior):

\documentclass[english,11pt,a4paper]{article}
\usepackage{longtable}

\newcommand{\demounderfullvbox}{%
\begin{longtable}{|l|p{2in}|}
%
%
\hline\multicolumn{2}{|l|}{\textsl{\ldots continued from previous page}}\\*
%
\multicolumn{2}{|l|}{\textsl{will be continued on next page\ldots}}\\*
\hline
\endfoot
%
\hline
\endlastfoot
%
\hline%
aa: & 4711\\
\hline%
aaa: & 2\\
\hline%
aaaa: & 4711-2\\
\end{longtable}
}

\begin{document}
\newpage
%
\demounderfullvbox
\demounderfullvbox
\demounderfullvbox

\end{document}


If tabular is used instead of longtable, no warnings occur, but that doesn't solve the problem, as much more rows can be placed in the tables.

Removing the trailing \\ in the aaaa: line has no effect either.

The "underfull \vbox" warnings seem to specify a source line that looks ok to me (this is more clearly when \demounderfullvbox is replaced by the example code), think the warning is provocated on computation of first LTchunk?

Thanks for help and suggestions in advance!

-

The underfull box is in fact the \hline at the start of the table (entered just after \endlastfoot)

If instead you remove it from there and put it at the end of the first head, as below, it all works out.

The reason for this eludes me at present but I'm sure it is all explained in detail in the package documentation......

\documentclass[english,11pt,a4paper]{article}
\usepackage{longtable}
\showboxdepth10

\newcommand{\demounderfullvbox}{%
\begin{longtable}{|l|p{2in}|}
\hline%
%
\hline
\multicolumn{2}{|l|}{\textsl{\ldots continued from previous page}}
%
\multicolumn{2}{|l|}{\textsl{will be continued on next page\ldots}}\\
\hline
\endfoot
%
\hline
\endlastfoot
%
aa: & 4711\\
\hline%
aaa: & 2\\
\hline%
aaaa: & 4711-2
\end{longtable}%
}

\begin{document}
\newpage
%
\demounderfullvbox
\demounderfullvbox
\demounderfullvbox

\end{document}

-
Oops - that simple \hline position was it... I must have moved it some days ago with the intent to have all "data" rows with the same source layout, but haven't recognized the side effect... Thank you very much for answering so quickly! –  tueftl Sep 11 '12 at 12:52

The example can be simplified to

\showboxdepth=\maxdimen

\documentclass{article}
\usepackage{longtable}[2004/02/01]
\begin{document}
\begin{longtable}{l}
\hline
x
\end{longtable}
\end{document}


The .log file contains:

Package: longtable 2004/02/01 v4.11 Multi-page Table package (DPC)
[...]
Underfull \vbox (badness 10000) detected at line 10

\vbox(8.39996+0.0)x345.0
.\penalty 10000
.\hbox(0.4+0.0)x345.0, glue set 163.8611fill
..\glue(\tabskip) 0.0 plus 1.0fill
..\hbox(0.4+0.0)x17.27782, glue set 17.27782fill
....\rule(0.4+0.0)x*
..\glue(\tabskip) 0.0 plus 1.0fill


Package longtable splits its contens in chunks (in \LT@start):

\dimen@ii\vfuzz
\vfuzz\maxdimen
\setbox\tw@\copy\z@
\setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
\setbox\tw@\vbox{\unvbox\tw@}%
\vfuzz\dimen@ii


Because of \unvbox\tw@ it does not matter if the splitted box by \vsplit is too large or too small. \setbox\tw@\vbox{\unvbox\tw@} sets the box in its natural size. Overfull boxes are catched by \vfuzz. If \hline starts the table, then \hline and the next line is too large for \ht\@arstrutbox. But the line itself is too small for \ht\@arstrutbox and generates the underfull \vbox.

BTW, the documentation says:

Also \hline may be used, as in tabular.

Therefore I consider this behavior as bug that can be fixed by setting \vbadness to 10000, see lines marked with (added):

\makeatletter
\def\LT@start{%
\let\LT@start\endgraf
\endgraf\penalty\z@\vskip\LTpre
\dimen@\pagetotal
\dimen@ii\vfuzz
\vfuzz\maxdimen
\setbox\tw@\copy\z@
\setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
\setbox\tw@\vbox{\unvbox\tw@}%
\vfuzz\dimen@ii
\ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
\ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
\ifdim \dimen@>\z@\vfil\break\fi
\global\@colroom\@colht
\ifvoid\LT@foot\else
\maxdepth\z@
\fi
\output{\LT@output}%
}
\makeatother

-
Thanks, I'd spotted the first bit but ran out of time checking if it would be safe just to silence the warning. I guess an update is called for... –  David Carlisle Sep 11 '12 at 14:41
@DavidCarlisle Agreed. Also feel free to consider Caption at foot of long tables as feature request :-) –  Heiko Oberdiek Sep 11 '12 at 15:04
@DavidCarlisle: maybe I've found another problem in the apart from that brilliant longtable. –  tueftl Sep 18 '12 at 12:29
Yes saw that, been too busy to look this week, may have to be the weekend, or if you are lucky @HeikoOberdiek may fix it for you:-) –  David Carlisle Sep 18 '12 at 12:32
@DavidCarlisle: could you find some time to add Heiko's patch please? –  Ulrike Fischer Oct 28 at 15:38