数字 flow/distribute 自动在 LateX 中翻页

Figures to flow/distribute automatically over pages in LateX

我有一个很长的 LaTeX 脚本来制作一个文档,其中大部分部分都有三个数字,它们非常适合页面。在一些随机部分,我们有六到九个数字。因此,页面将无法容纳这些额外的数字,它们将叠加在页面底部。

如何自动强制最后三个数字显示在单独的页面上,而无需手动调整每个部分? (换句话说,一种使清除页面自动完成的方法)。

我正在寻找类似于 longtable – Allow tables to flow over page boundaries 环境的东西来自动控制流量。

以下是常规和随机情况的示例:

***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

figure 环境不支持分页符。如果你想要一些东西来打破页面,不要使用 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}

感谢大家的反馈。我检查了互联网上关于这个问题的几个帖子,有几个方法可以解决这个问题(相当好但不是 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

第二种方案参考:Subfigure in LaTeX – Full Guide

第三个解决方案:使用@Prof 创建的figureSeries 包。托马斯·怀斯。可惜好久没更新了

第三种方案参考:figureSeries Package on GitHub and figureSeries Package on Stack Exchange