我正在使用 LaTeX 写一篇论文,并使用 subfig 包来排列图像。我的问题是,当我使用 2 x 3 图像和占据 2 列的 subfloat 时,主标题会被换行。我也尝试过使用它\captionsetup
来设置宽度、格式……但不起作用。
代码如下:
\begin{figure}[t]
\subfloat[8 images]{{\includegraphics[width=5.5cm]{screenshots/Comparison/8_jump} }}%
\subfloat[16 images]{{\includegraphics[width=5.5cm]{screenshots/Comparison/16_jump} }}%
\subfloat[32 images]{{\includegraphics[width=5.5cm]{screenshots/Comparison/32_jump} }}%
\hfill
\subfloat[8 times]{{\includegraphics[width=5.5cm]{screenshots/Comparison/8_ours_jump} }}%
\subfloat[16 times]{{\includegraphics[width=5.5cm]{screenshots/Comparison/16_ours_jump} }}%
\subfloat[32 times]{{\includegraphics[width=5.5cm]{screenshots/Comparison/32_ours_jump} }}%
\caption{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA long caption which occupies two column, but it is wrapped into one column.}%
\label{fig:Comparison}%
\end{figure}
如何输入占据两列的主标题?
答案1
我从您的描述中推断(虽然没有明确说明),您的文档使用双列格式。此外,您希望生成一个横跨两个文本列的图形。如果是这样,您应该使用环境figure*
而不是figure
环境;前者设置为横跨两列,因此其标题也将能够横跨图形的整个宽度。
我还建议您不要为子图设置绝对宽度,而是使用相对宽度。这样做可以更直接地高效填充可用空间,而无需进行大量的反复试验。
下列屏幕截图中三条边周围的细线是由showframe
包插入的;它们仅仅是为了说明文本块的边缘。
\documentclass[twocolumn]{article}
\usepackage{subfig} % for "\subfloat" macros
\usepackage[demo]{graphicx} % remove "demo" option in your real document
\usepackage{showframe} % just to illustrate borders of text block
\usepackage{lipsum} % package that provides filler text
\begin{document}
\lipsum[1-2] % filler text
\begin{figure*}[t!]
\subfloat[8 images]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/8_jump}}\hspace*{\fill}
\subfloat[16 images]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/16_jump}}\hspace*{\fill}
\subfloat[32 images]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/32_jump}}
\subfloat[8 times]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/8_ours_jump}}\hspace*{\fill}
\subfloat[16 times]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/16_ours_jump}}\hspace*{\fill}
\subfloat[32 times]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/32_ours_jump}}
\caption{Six subfigures with a very long caption which now occupies both columns. Observe that the caption is no longer confined to the first, i.e., left-hand, column.}
\label{fig:Comparison}
\end{figure*}
\lipsum[3-9] % more filler text
\end{document}