我有一个很长的LaTeX脚本来制作一个文档,其中大多数部分都有三个数字,它们非常适合页面。在一些随机的部分,我们有六到九个数字。因此,页面将无法容纳这些额外的数字,它们将覆盖在页面底部。
如何自动强制最后三个数字显示在单独的页面上,而不需要手动调整每个部分?(换句话说,这是一种自动完成清除页面的方法(。
我正在寻找类似于longable的东西——允许表在页面边界环境中流动,以自动控制流动。
这里有一个规则和随机情况的例子:
***Regular case***
begin{figure}[b!]
centering
includegraphics[width =textwidth]{Path/A.png}
includegraphics[width =textwidth]{Path/B.png}
includegraphics[width =textwidth]{Path/C.png}
end{figure}
clearpage
***Random case***
begin{figure}[b!]
centering
includegraphics[width =textwidth]{Path/E.png}
includegraphics[width =textwidth]{Path/F.png}
includegraphics[width =textwidth]{Path/G.png}
includegraphics[width =textwidth]{Path/H.png}
includegraphics[width =textwidth]{Path/I.png}
includegraphics[width =textwidth]{Path/J.png}
includegraphics[width =textwidth]{Path/K.png}
includegraphics[width =textwidth]{Path/L.png}
end{figure}
clearpage
感谢大家的反馈。我查看了互联网上关于这个问题的几篇帖子,有几种方法可以解决这个问题(相当好,但不是100%(。
第一个解决方案:如@samcarter_is_at_topanswers.xyz所述,figure
环境不支持分页符。captionof
(来自字幕包(和label
可用于图形字幕和参考。
begingroup
centering
includegraphics[width =textwidth]{Path/A.png}
includegraphics[width =textwidth]{Path/B.png}
includegraphics[width =textwidth]{Path/C.png}
includegraphics[width =textwidth]{Path/D.png}
includegraphics[width =textwidth]{Path/E.png}
includegraphics[width =textwidth]{Path/F.png}
includegraphics[width =textwidth]{Path/G.png}
includegraphics[width =textwidth]{Path/H.png}
includegraphics[width =textwidth]{Path/J.png}
captionof{figure}{Whatever caption}
label{WhateverLabel}
endgroup
第二个解决方案(不是最好的自动化解决方案(:将figure
划分为subfigure
,并使用ContinuedFloat
来拆分页面,但标题和标签相同。
begin{figure}[b!]
centering
begin{subfigure}[b!]{textwidth}
centering
includegraphics[width =textwidth]{Path/A.png}
end{subfigure}
begin{subfigure}[b!]{textwidth}
centering
includegraphics[width =textwidth]{Path/B.png}
end{subfigure}
begin{subfigure}[b!]{textwidth}
centering
includegraphics[width =textwidth]{Path/C.png}
end{subfigure}
caption{whatever caption}
label{WhateverLabel}
end{figure}
clearpage
begin{figure}[b!]
ContinuedFloat
begin{subfigure}[b!]{textwidth}
centering
includegraphics[width =textwidth]{Path/D.png}
end{subfigure}
begin{subfigure}[b!]{textwidth}
centering
includegraphics[width =textwidth]{Path/E.png}
end{subfigure}
begin{subfigure}[b!]{textwidth}
centering
includegraphics[width =textwidth]{Path/F.png}
end{subfigure}
caption{whatever caption}
label{WhateverLabel}
end{figure}
clearpage
第二种解决方案的参考:LaTeX中的子图——全引导
第三种解决方案:使用@Prof.创建的figureSeries
包。托马斯·维斯。不幸的是,它已经有一段时间没有更新了。
第三种解决方案的参考:GitHub上的figureSeries包和Stack Exchange 上的graphicSeries包
figure
环境不支持分页符。如果你想要一些东西来破坏页面,不要使用图形环境。
如果你仍然需要一个标题和类似的东西,你可以使用这样的caption
包:
documentclass{article}
usepackage{graphicx}
usepackage{caption}
begin{document}
begingroup
centering
includegraphics[width =textwidth]{example-image-duck}
includegraphics[width =textwidth]{example-image-duck}
includegraphics[width =textwidth]{example-image-duck}
includegraphics[width =textwidth]{example-image-duck}
includegraphics[width =textwidth]{example-image-duck}
includegraphics[width =textwidth]{example-image-duck}
includegraphics[width =textwidth]{example-image-duck}
includegraphics[width =textwidth]{example-image-duck}
captionof{figure}{whatever caption}
endgroup
end{document}