In a document I maintain, one of our tables was discovered to be overlapping with the bottom margin. TeX did not produce any error or warning indicating that there was a problem.
The original case is here: https://github.com/cplusplus/draft/issues/1567
Reduced testcase:
\documentclass{memoir}
\usepackage[american]{babel}
\usepackage{longtable}
\setulmarginsandblock{1in}{2in}{*}
\checkandfixthelayout
\makepagestyle{mypage}
\makeevenhead{mypage}{}{This is the top of the page}{}
\makeoddhead{mypage}{}{This is the top of the page}{}
\makeevenfoot{mypage}{}{This is the bottom of the page}{}
\makeoddfoot{mypage}{}{This is the bottom of the page}{}
\pagestyle{mypage}
\begin{document}
\begin{table}
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
\end{table}
\begin{longtable}{l}
longtable \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
\end{longtable}
\begin{longtable}{l}
longtable 2 \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
X \\
\end{longtable}
\end{document}
It appears that the problem occurs when a floating table
environment and two longtable
environments appear on the same page; the second longtable
appears to break too late (by the height of the table
, I think).
What can I do to systematically avoid this problem, or at least to get TeX to warn if it happens again?