如何才能阻止内容与页脚重叠?

如何才能阻止内容与页脚重叠?

我正在尝试使用 LaTeX 生成人们在我的网站上创建的备忘单的 PDF 版本。它们都是三列文档,实际上每个文档都包含多个表格。

在大多数情况下,LaTeX 可以很好地将内容划分为列。但是,有时某些块会与页脚重叠。我有一个测试文档(使用 lualatex 构建,基于这个 tex 文件),您可以看到第 2 页的第一列中“指令”块与页脚重叠。

我尝试了几种不同的方法来解决这个问题。最接近的解决方案是在每个表格后添加一个 mbox,如下所示此 PDF(从这个 tex 文件)。如您所见,不再存在重叠问题。但是,在第 3 页上,第 2 列顶部现在有一个间隙。

有人知道我怎样才能阻止列与页脚重叠,而不会在某些列的顶部引入奇怪的间隙吗?

答案1

在这里你没有给 LaTeX 太多的机会 :-) 每个部分都是一个牢不可破的表格(tabularxtabulary大部分),因为 LaTeX 从不重新排序内容,所以不可避免地会出现过满的框或很大的间隙。LaTeX 确实抱怨很多

Overfull \vbox (52.91997pt too high) has occurred while \output is active
Overfull \vbox (51.91997pt too high) has occurred while \output is active
Overfull \vbox (50.91997pt too high) has occurred while \output is active
Overfull \vbox (49.91997pt too high) has occurred while \output is active
Overfull \vbox (48.91997pt too high) has occurred while \output is active
Overfull \vbox (47.91997pt too high) has occurred while \output is active
Overfull \vbox (46.91997pt too high) has occurred while \output is active
Overfull \vbox (45.91997pt too high) has occurred while \output is active
Overfull \vbox (44.91997pt too high) has occurred while \output is active
Overfull \vbox (43.91997pt too high) has occurred while \output is active
Overfull \vbox (42.91997pt too high) has occurred while \output is active
Overfull \vbox (41.91997pt too high) has occurred while \output is active
Overfull \vbox (40.91997pt too high) has occurred while \output is active
Overfull \vbox (39.91997pt too high) has occurred while \output is active
Overfull \vbox (38.91997pt too high) has occurred while \output is active
Overfull \vbox (37.91997pt too high) has occurred while \output is active
Overfull \vbox (36.91997pt too high) has occurred while \output is active

第二页的表格 NgModelController根本放不下该列,您可以在\columnbreak其前面放置一个,这会使该列变得很短,并且除非您也强制在该列中断,否则也会导致下一列出现问题。

我怀疑在这种情况下,各个表格或多或少是独立的,而这种布局的更好算法是测量每个表格,然后添加最适合当前列的表格。这并非不可能,但 LaTeX 并没有真正提供对这种布局的开箱即用支持,如果只是一份文档,而不是自动打印从某个数据库转储的数千页数据,那么手动重新排列表格可能更好。

或者当然,您可以使用可拆分表并允许它们换行到下一列。虽然使用 longtable 通常具有的重复标题功能有点困难,但它相当容易使用longtablemulticol例如,此站点上有一些代码)。

相关内容