图前有小文字,长标题在下一页

图前有小文字,长标题在下一页

我有一个图题太长,无法放在图像的同一页中。我想在图像前面加一点文字,然后以图题开始下一页,然后再加文字,如下图所示:

(我使用分段是因为我需要让图形不要离第 1 节太远)

我正在寻找的结果图像

以下是我能得到的最接近的代码:

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{afterpage}
\usepackage{environ}
\usepackage{mwe}

\newsavebox{\doublepagecaption}
\newsavebox{\doublepageimage}

\NewEnviron{doublepagefigure}[2][]% #1=short caption (optional), #2=caption
{\global\setbox\doublepagecaption=\hbox{%
  \parbox{\textwidth}{\captionof{figure}[#1]{#2}}}%
 \global\setbox\doublepageimage=\hbox{\parbox{\textwidth}{\BODY}}%
 \afterpage{
 \ifodd\value{page}%
   \afterpage{%
    \vspace*{\fill}\vspace{-\baselineskip}%
    \noindent\usebox{\doublepageimage}\vfill\pagebreak
    \begin{figure}[b]\usebox{\doublepagecaption}\end{figure}}%
 \else
   \vspace*{\fill}\vspace{-\baselineskip}%
   \noindent\usebox{\doublepageimage}\vfill\pagebreak
   \begin{figure}[b]\usebox{\doublepagecaption}\end{figure}%
 \fi}}

\renewcommand{\bottomfraction}{0.5}% fraction of page allowed for bottom floats

\begin{document}

\section{Section 1}

\lipsum[1]

\begin{doublepagefigure}[(Caption next page.)]{\textbf{\lipsum[2-3]}\label{fig:test1}}
\centering{
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig1}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig2}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig3}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig4}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig5}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig6}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig7}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig8}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}
    \caption{vero eos et accusamus et}\label{subfig9}
    \includegraphics[width=0.3\linewidth]{example-image}
\end{subfigure}
}
\end{doublepagefigure}


\lipsum[4-7]

\section{Section 2}

\lipsum[8-10]

\end{document}

使用 John 的代码(图片在偶数页,标题在下一页),我得到的结果如下:

在此处输入图片描述

我无法解决的问题:

(1)子图聚集在一起,

(2)子图的标题不显示,

(3)标题位于下一页的底部,而不是顶部(来自\renewcommand{\bottomfraction}{0.5}但“topfraction”或更低的分数会将标题推到第 4 页),

(4)图形上方没有文字,

(5) 我并不一定需要将图形放在偶数页上。

如何才能正确地做到这一点?

答案1

只是为了展示如何使代码适用于您的示例。请注意,subcaption 包需要 subfigure 的宽度参数(和\def\@captype{figure})。另一方面,不再需要使用 caption 包(没有\captionof)。

此外,简短的标题仅供参考\listoffigures

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage[english]{babel}
\usepackage{subcaption}
\usepackage{afterpage}
\usepackage{environ}
\usepackage{mwe}

\newsavebox{\doublepagecaption}
\newsavebox{\doublepageimage}
\makeatletter
\NewEnviron{doublepagefigure}[2][]% #1=short caption (optional), #2=caption
{\def\@captype{figure}%
 \global\setbox\doublepagecaption=\vbox{\caption[#1]{#2}}%
 \global\setbox\doublepageimage=\vbox{\BODY}%
 \afterpage{%
 \ifodd\value{page}%
   \afterpage{%
    \vspace*{\fill}\vspace{-\baselineskip}%
    \noindent\usebox{\doublepageimage}\vfill\pagebreak
    \begin{figure}[t]\usebox{\doublepagecaption}\end{figure}}%
 \else
   \vspace*{\fill}\vspace{-\baselineskip}%
   \noindent\usebox{\doublepageimage}\vfill\pagebreak
   \begin{figure}[t]\usebox{\doublepagecaption}\end{figure}%
 \fi}}
\makeatother

\renewcommand{\bottomfraction}{0.5}% fraction of page allowed for bottom floats

\begin{document}

\section{Section 1}

\lipsum[1]

\begin{doublepagefigure}[(Caption next page.)]{\textbf{\lipsum[2-3]}\label{fig:test1}}
\centering
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig1}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig2}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig3}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig4}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig5}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig6}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig7}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig8}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
    \caption{vero eos et accusamus et}\label{subfig9}
    \includegraphics[width=\linewidth]{example-image}
\end{subfigure}
\end{doublepagefigure}


\lipsum[4-7]

\section{Section 2}

\lipsum[8-10]

\end{document}

相关内容