组合表格和长表格时如何避免底部边距重叠

组合表格和长表格时如何避免底部边距重叠

在我维护的一份文档中,我们发现其中一个表格与底部边距重叠。TeX 没有产生任何错误或警告来表明存在问题。

原始案例在这里:https://github.com/cplusplus/draft/issues/1567

简化的测试用例:

\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}

简化测试用例的渲染

看起来,问题出现在同一个页面上出现一个浮动table环境和两个环境时;第二个环境似乎中断得太晚了(我认为,是由于 的高度)。longtablelongtabletable

我该怎么做才能系统地避免这个问题,或者至少让 TeX 在再次发生时发出警告?

相关内容