我有几个章节以奇数页结尾,我想在接下来的偶数页中填入一个图形,以图形方式概述下一章的内容。此图应正确编号为下一章的第一张图。
梅威瑟:
\documentclass{scrbook}
\usepackage{graphicx,blindtext}
\usepackage{nextpage}
\begin{document}
\chapter{First Chapter}
\blindtext
\begin{figure}[b!]% float specifier only used so that first chapter ends on odd page
\centering
\includegraphics[width=.5\linewidth]{example-image-b}
\caption{This figure belongs to chapter~1. Should be numbered as Figure~1.1.}
\end{figure}
\cleartoevenpage
\thispagestyle{plain}
\stepcounter{chapter}
\setcounter{figure}{0}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{example-image-b}
\caption{This figure gives a graphical overview of chapter~2. Should be numbered as Figure~2.1.}
\end{figure}
\cleardoublepage
\addtocounter{chapter}{-1}
\chapter{Second Chapter}
\stepcounter{figure}
\blindtext
\begin{figure}
\centering
\includegraphics[width=.5\linewidth]{example-image-c}
\caption{This is another figure, should be numbered as Figure~2.2.}
\end{figure}
\listoffigures
\end{document}
如您所见,example-image-b 从第 2 章标题左侧的奇数页开始。这就是我想要的效果。
然而,这会弄乱图表列表中的间距,因为图 2.1 与图 1.1 一起列出,而章节间间距则在其后。
由于我的方法很不靠谱,肯定还有更好的方法我不知道。任何帮助我都会很感激。
请注意,如果前面的章节没有以奇数页结束,我当前的破解就会失败,但是就我的情况而言,这种限制是可以接受的。
这不是重复的这个问题因为我想要一个正确编号的图形,而不仅仅是\includegraphics
偶数页上的一些插图。
答案1
这是一个手动解决方案,可以尽可能地保留您的代码。首先,我们在图 2.1 之前添加额外的垂直空间(10pt):
\begin{figure}
\centering
\includegraphics[width=\linewidth]{example-image-b}
\addtocontents{lof}{\protect\addvspace{10pt}}%<<<
\caption{This figure gives a graphical overview of chapter~2. Should be numbered as Figure~2.1.}
\end{figure}
然后我们把图2.2之前的同样数量删除:
\begin{figure}
\centering
\includegraphics[width=.5\linewidth]{example-image-c}
\addtocontents{lof}{\protect\addvspace{-10pt}}%<<<
\caption{This is another figure, should be numbered as Figure~2.2.}
\end{figure}
平均能量损失
\documentclass{scrbook}
\usepackage{graphicx,blindtext}
\usepackage{nextpage}
\begin{document}
\listoffigures
\chapter{First Chapter}
\blindtext
\begin{figure}[b!]% float specifier only used so that first chapter ends on odd page
\centering
\includegraphics[width=.5\linewidth]{example-image-b}
\caption{This figure belongs to chapter~1. Should be numbered as Figure~1.1.}
\end{figure}
\cleartoevenpage
\thispagestyle{plain}
\stepcounter{chapter}
\setcounter{figure}{0}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{example-image-b}
\addtocontents{lof}{\protect\addvspace{10pt}}
\caption{This figure gives a graphical overview of chapter~2. Should be numbered as Figure~2.1.}
\end{figure}
\cleardoublepage
\addtocounter{chapter}{-1}
\chapter{Second Chapter}
\stepcounter{figure}
\blindtext
\begin{figure}
\centering
\includegraphics[width=.5\linewidth]{example-image-c}
\addtocontents{lof}{\protect\addvspace{-10pt}}
\caption{This is another figure, should be numbered as Figure~2.2.}
\end{figure}
\listoffigures
\end{document}