总结末尾以粗体显示。
因此,我正在为班级编写一本实验手册memoir
,并将paracol
一些实验室用具的图片放在右栏中,这样它们就不会使正文杂乱无章。到目前为止,一切顺利。现在,我有一些图片想显示得更大,环境figure
要占据整个线宽,所以我将它们从环境中取出paracol
,并将它们设置在常规的单栏figure
环境中,从而中断paracol
环境
我希望这些图像连续编号并研究了各种可能的部分解决方案。此外,我设法将章节和节的编号去掉,因为这与我的文档无关。说到无关紧要,我们不再讨论这个问题,看看一些代码,让你在家尝试一下:
\documentclass[a4paper,oneside,openany,12pt]{memoir}
\usepackage{duckuments}
\usepackage{graphicx} % for the duckument images
% functionality from chngcntr included in memoir class
\counterwithout{figure}{chapter}
\counterwithout{section}{chapter}
\usepackage{paracol}
\setcolumnwidth{0.58\textwidth}
\begin{document}
\listoffigures
\section{First Duck}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{First Duck}
\end{figure}
\newpage
\section{Second Duck}
\begin{paracol}{2}
\blindduck
\switchcolumn
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Second duck}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Third duck}
\end{figure}
\switchcolumn
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Force duck}
\end{figure}
\end{paracol}
\newpage
\section{Fifth Duck}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Fifth Duck}
\end{figure}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Inter-Duck}
\end{figure}
\newpage
\section{The Sith duck}
\begin{paracol}{2}
\blindduck
\switchcolumn
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Sith duck}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Seventh duck}
\end{figure}
\switchcolumn
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Eighth duck}
\end{figure}
\end{paracol}
\end{document}
编译时您会注意到(前提是您已安装duckuments
并按照步骤正确设置),您会注意到图形的编号是奇数。您可以尝试不同的设置,以确定何时调用paracol
并将图像放在不同的地方。对于那些古怪的人,我建议在 paracol 环境之后再使用第二个 paracol 环境。结果很有趣!
我希望正文中偶尔会以常规方式显示图片,并在右列(或左列,随便什么都行)显示图片。所有图片都应连续编号。但这并不需要参加回忆录课程并融入 paracol 环境,但这是迄今为止我能想到的最好的办法。
答案1
首先,我们需要在序言中告诉memoir
使用 a \globalcounter{figures}
。这将修复数字,因为相同的数字不会重复出现。但现在它们不是按顺序排列的。
[图形] 按照它们在辅助文件中出现的顺序列出,这是它们展开的顺序(左列优先),而不是创建的顺序。
因此,与 LaTeX 中所使用的相比,图形的顺序需要更加手动地管理。
此时,您可能已经注意到图 4 在 LOF 中紧接着图 1 列出(原因请参见上面的引文)。要更改此设置,您可以paracol
在图 3 之后结束环境并paracol
立即开始另一个环境,然后使用变体 1。或者,您可以重新排列源代码,然后使用变体 2。但请注意,变体 2 将改变图的编号顺序。在示例中,“Force Duck”变为图 2。
最后,您可以选择将所有小图像放在一列中,而只有文本放在另一列中。在这种情况下,\switchcolumn
文本和图像之间。\globalcounter{figures}
启用后,您的图形应该可以正确编号(未经测试)。
变体 1
\documentclass[a4paper,oneside,openany,12pt]{memoir}
\usepackage{duckuments}
\usepackage{graphicx} % for the duckument images
% functionality from chngcntr included in memoir class
\counterwithout{figure}{chapter}
\counterwithout{section}{chapter}
\usepackage{paracol}
\setcolumnwidth{0.6\textwidth}
\globalcounter{figure}
\begin{document}
\listoffigures
\section{First Duck}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{First Duck}
\end{figure}
\clearpage
\section{Second Duck}
\begin{paracol}{2}
\blindduck
\switchcolumn
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Second Duck}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Thursduck}
\end{figure}
\switchcolumn[0]
\blindduck
\end{paracol} % NEW
% NEW
\begin{paracol}{2} % NEW
\switchcolumn[0]*
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Force Duck}
\end{figure}
\end{paracol}
\clearpage
\section{Fifth Duck}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Fifth Duck}
\end{figure}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Sith Duck}
\end{figure}
\clearpage
\section{Seven Ducks}
\begin{paracol}{2}
\blindduck
\switchcolumn
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Seven Ducks}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Eighduck}
\end{figure}
\switchcolumn
\blindduck
\end{paracol}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Ninth Duck}
\end{figure}
\end{document}
变体 2
\documentclass[a4paper,oneside,openany,12pt]{memoir}
\usepackage{duckuments}
\usepackage{graphicx} % for the duckument images
% functionality from chngcntr included in memoir class
\counterwithout{figure}{chapter}
\counterwithout{section}{chapter}
\usepackage{paracol}
\setcolumnwidth{0.6\textwidth}
\globalcounter{figure}
\begin{document}
\listoffigures
\section{First Duck}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{First Duck}
\end{figure}
\clearpage
\section{Second Duck}
\begin{paracol}{2}
\blindduck
\blindduck % MOVED
\begin{figure}[htbp] % MOVED
\centering % MOVED
\includegraphics{example-image-duck} % MOVED
\caption{Force Duck} % MOVED
\end{figure} % MOVED
\switchcolumn
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Second Duck}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Thursduck}
\end{figure}
\end{paracol}
\clearpage
\section{Fifth Duck}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Fifth Duck}
\end{figure}
\blindduck
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Sith Duck}
\end{figure}
\clearpage
\section{Seven Ducks}
\begin{paracol}{2}
\blindduck
\switchcolumn
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Seven Ducks}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Eighduck}
\end{figure}
\switchcolumn
\blindduck
\end{paracol}
\begin{figure}[htbp]
\centering
\includegraphics{example-image-duck}
\caption{Ninth Duck}
\end{figure}
\end{document}