I think I may have stumbled upon an undocumented feature regarding page breaking in longtable.

The following MWE produces (at least in my TeXlive 2014 setup) a document in which the last paragraphs overflow the bottom of the page.



    \sffamily \lipsum[2]
    \caption{A figure}

    a & b \\
    c & d 

    \sffamily \lipsum[1]
    \caption{A figure}



The result is:

enter image description here

The problem is, I think, related to longtabu and floats: wrong table breaks on pages with floats. Note that I am working with a patched version of longtable.sty, as per David Carlisle's suggestions (patch available at http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=tools/3512, which, incidentally has not made it into TeXlive 2014, despite having been around >2 years).

The difference with the earlier question is that my float appears after the long table. Moving the float above the longtable fixes the problem, but this is clearly not a real solution. Does anyone happen to know how to fix this?


2 Answers 2


There's no bugs in longtable: only interesting features.

so.. LT overshoots the page and TeX complains:

Overfull \vbox (89.34776pt too high) has occurred while \output is active

In an ideal world that wouldn't happen, but if it does, you can give the page breaker a helping hand and shorten it by the stated amount.

    a & b \\
    c & d 

I think it's cruelty to output routine authors to have a multi-page table that's less than a page long and have one float before the table and one float after the table, all on the same page:-)

  • Thanks, David. I was hoping you in particular could help with this. You're right, I missed one additional line in the MWE. I've updated it and added a screenshot. Could you have another look if you have time? Much appreciated!
    – yori
    Sep 28, 2014 at 23:41
  • 1
    LOL @ interesting features btw. I have rephrased the question accordingly.
    – yori
    Sep 28, 2014 at 23:45
  • @Yori answer undeleted and edited:-) Sep 30, 2014 at 20:40

I can't comment because I am new so I will have to put this in an answer. I ran into this issue the other day because pandoc has switched to using longtable for all latex tables.


"The LaTeX writer now uses longtable instead of ctable. This allows tables to be split over page boundaries."

Anyway I imagine a lot more people are running into this since pandoc is what is used to generate tables when using RMarkdown to generate latex documents.

I applied the old patch and it did fix it however the linenumbers are slightly different now:

diff longtable.sty.bak longtable.sty
<     \advance\vsize-\ht\LT@foot
>     \global\advance\vsize-\ht\LT@foot
>   \ifvoid\LT@foot\else
>     \global\advance\vsize\ht\LT@foot
>     \global\advance\@colroom\ht\LT@foot
>     \dimen@\pagegoal\advance\dimen@\ht\LT@foot\pagegoal\dimen@
>   \fi
<   \pagegoal\vsize
>         \advance\dimen@\ht\LT@foot
>             \global\vsize\@colroom
<       \global\@colroom\@colht
<       \global\vsize\@colht
<       \vbox
<         {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
>       \unvbox\z@\ifvoid\LT@lastfoot\copy\LT@foot\else\box\LT@lastfoot\fi
  • When I say it fixed it I mean it fixed my issue where I had 1 float and 1 longtable, not 1 long table with a float before and after.
    – Dalupus
    Oct 18, 2014 at 15:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .