确保浮动直接出现在 `\afterpage` 和 `landscape` 之后

确保浮动直接出现在 `\afterpage` 和 `landscape` 之后

我有一个大型(整页)横向图形,我想让它出现在大型(整页)纵向图形对面的页面上。横向图形的生成方式如下:

\afterpage{
    \begin{landscape}
        \begin{figure}
            \centering
            \includegraphics[scale=1]{path/to/the/file.pdf}
            \caption{The Caption}
        \end{figure}
    \end{landscape}
}

允许afterpage横向页面浮动。现在我想添加一个在对面页面上的图形;我目前已通过将其添加到landscape并旋转来完成此操作:

\afterpage{
    \begin{landscape}
        \begin{figure}
            \centering
            \includegraphics[scale=1]{path/to/the/file.pdf}
            \caption{The Caption}
        \end{figure}

        \begin{figure}
            \centering
            \includegraphics[scale=1,angle=-90]{path/to/another/file.pdf}
            \caption{The Other Caption}
        \end{figure}
    \end{landscape}
}

但这存在一些问题 - 首先,它不能确保它们位于对开页上(只能确保它们位于连续的页面上),其次,它会导致第二个图形的标题旋转,这并不理想,因为它实际上是一个肖像图。

我一直在寻找这个问题的解决方案,但似乎找不到。有人能给我建议或给我指明正确的方向吗?

答案1

我只需将第二个图形放在风景后面,而不是将其旋转两次。

\afterpage{%
\clearpage
    \begin{landscape}
        \begin{figure}
            \centering
            \includegraphics[scale=1]{path/to/the/file.pdf}
            \caption{The Caption}
        \end{figure}
\end{landscape}
        \begin{figure}
            \centering
            \includegraphics{path/to/another/file.pdf}
            \caption{The Other Caption}
        \end{figure}
\clearpage
}

要检查它是否从偶数页开始,你应该能够做到

\afterpage{\clearpage
\ifodd\value{page}
\afterpage{...}
\else
...
\fi
}

所以如果它落在奇数页面上,它就会再次被推迟。

相关内容