我有 8 个图表,需要包含在双栏格式的论文中。图表应添加在相应页面的顶部,每行三个图表(图表对齐方式与双栏格式不同)。
IE:
fig1: fig2: fig3:
fig4: fig5: fig6:
每个图形不应该以(a)
...... (b)
...... 开头。
有人能告诉我如何用 LaTeX 做到这一点吗?
答案1
您可以使用subcaption
在浮点数内生成子元素:
\documentclass[twocolumn]{article}
\usepackage{lipsum,graphicx,subcaption}
\captionsetup[subfigure]{labelformat=simple,labelsep=colon}
\renewcommand{\thesubfigure}{fig\arabic{subfigure}}
\begin{document}
\begin{figure*}[t]
\centering
\subcaptionbox{Fig1}[.3\linewidth][c]{%
\includegraphics[width=.2\linewidth]{example-image-a}}\quad
\subcaptionbox{Fig2}[.3\linewidth][c]{%
\includegraphics[width=.2\linewidth]{example-image-b}}\quad
\subcaptionbox{Fig3}[.3\linewidth][c]{%
\includegraphics[width=.2\linewidth]{example-image-c}}
\bigskip
\subcaptionbox{Fig4}[.3\linewidth][c]{%
\includegraphics[width=.2\linewidth]{example-image-c}}\quad
\subcaptionbox{Fig5}[.3\linewidth][c]{%
\includegraphics[width=.2\linewidth]{example-image-b}}\quad
\subcaptionbox{Fig6}[.3\linewidth][c]{%
\includegraphics[width=.2\linewidth]{example-image-a}}
\caption{This is a figure}
\end{figure*}
\lipsum[1-10]
\end{document}
请注意,模式下的跨列浮动twocolumn
将始终跟随您放置环境的页面figure*
。如果您希望它位于不同的页面上,则需要相应地调整位置。
答案2
该包的一个简单方法multicol
:
\documentclass[twocolumn]{article}
\usepackage{lipsum,graphicx,multicol}
\begin{document}
%\abovecaptionskip=0pt
\begin{figure*}[t]
\begin{multicols}{3}
\includegraphics[width=\linewidth]{example-image-a}\par\caption{caption}
\includegraphics[width=\linewidth]{example-image-b}\par\caption{caption}
\includegraphics[width=\linewidth]{example-image-c}\par\caption{caption}
\end{multicols}
\begin{multicols}{3}
\includegraphics[width=\linewidth]{example-image-a}\par\caption{caption}
\includegraphics[width=\linewidth]{example-image-b}\par\caption{caption}
\includegraphics[width=\linewidth]{example-image-c}\par\caption{caption}
\end{multicols}
\end{figure*}
\lipsum[1-10]
\end{document}
答案3
好吧,这比我想象的要复杂一些。最难的部分是让链接到达图片的顶部。
我应该提到,图 1-3 的超链接实际上都链接到图 3。但只要它们都在同一级别,那就没关系。如果您想设置标签,请在相应的 \figtarget 之后进行。
\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{mwe}
\usepackage{hyperref}
\hypersetup{pdftoolbar=true,pdfpagemode=UseNone,pdfstartview=FitH,
colorlinks=true,extension=}
\newcounter{multifig}
% uased to synchronize \figtarget to \figcaption
\newcommand{\multifig}{\setcounter{multifig}{\thefigure}}
% location of hyperlink target (place \label after)
\newcommand{\figtarget}{\refstepcounter{figure}}
% corresponding caption
\newcommand{\figcaption}[1]% #1 = text
{\stepcounter{multifig}
\addcontentsline{lof}{figure}{\string\numberline {\arabic{multifig}}{\ignorespaces #1}}
Figure \arabic{multifig}: #1}
\begin{document}
\listoffigures
\begin{figure*}[t]
\multifig% better safe than sorry
\centering
\begin{tabular}{ccc}
\figtarget & \figtarget & \figtarget \\
\includegraphics[width=1.5in]{example-image} &
\includegraphics[width=1.5in]{example-image-a} &
\includegraphics[width=1.5in]{example-image-b} \\
\figcaption{first} & \figcaption{second} & \figcaption{third} \\
\figtarget & \figtarget & \figtarget \\
\includegraphics[width=1.5in]{example-image} &
\includegraphics[width=1.5in]{example-image-a} &
\includegraphics[width=1.5in]{example-image-b} \\
\figcaption{fourth} & \figcaption{fifth} & \figcaption{sixth}
\end{tabular}
\end{figure*}
\lipsum[1-8]
\begin{figure}[t]
\centering\includegraphics[width=1.5in]{example-image}
\caption{normal}
\end{figure}
\lipsum[9]
\end{document}
除了表格之外,还可以将每个图像/标题放入单独的 parbox,然后使用 \hfill 或 \hfil 将它们打包在一起。