6

I have 8 figures, which need to included in a two-column style paper. The figures should be added at the top of the corresponding page, three figures in each row (figure alignment is not as the two-column style).

i.e.:

fig1:   fig2:    fig3:

fig4:   fig5:    fig6:

Each figure should not start with (a)... (b)...... likewise.

Can anybody tell how to do this in LaTeX?

jub0bs
  • 58,916
  • Welcome to TeX.SX! Your post was migrated here from another Stack Exchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – jub0bs Jun 25 '14 at 16:51
  • 1
    See this question: http://tex.stackexchange.com/questions/37581/latex-figures-side-by-side – Stephan Lehmke Jun 25 '14 at 16:55
  • You can also arrange them using a tabular. Unlike captions (which are used by hyperref and the toc) subcaptions are just text. – John Kormylo Jun 25 '14 at 21:28
  • If you want to place multiple figures with captions into a single float, use \capstart from hypcap at the beginning, and either add multiple captions or use \refstepcounter{figure} and \label{fig:} where you write the captions. – John Kormylo Jun 25 '14 at 21:35
  • My apologies. I hit the down vote button in error and didn't notice until too late. – John Kormylo Jun 26 '14 at 03:54

3 Answers3

5

You can use subcaption to produce sub-elements inside a float:

enter image description here

\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}

Note that column-spanning floats in twocolumn mode will always follow the page where you put the figure* environment. If you want it on a different page, you need to adjust the placement accordingly.

Werner
  • 603,163
5

One simple approach with the multicol package:

\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}
Fran
  • 80,769
  • It works with hyperref and \listoffigures, but not hypcap. – John Kormylo Jun 27 '14 at 16:17
  • @JohnKormy I disagree. As far I can see, the MWE works perfectly in TeXLive 2013 with hypcap also, using evince as pdf viewer. Try using this package after hyperref and one \capstart for each each \includegraphics (six commands), just before of each image. – Fran Jun 27 '14 at 16:44
  • Eek! All this time I've been typing \startcap instead of \capstart! It appears I just re-invented the wheel for no reason. – John Kormylo Jun 27 '14 at 18:25
  • @Fran: It works brilliantly, but the problem is I am not able to add labels to my subfigures. How do I do that? – Srivatsan Nov 20 '15 at 16:00
  • 1
    @ThePredator I see no problem with \caption{... \label{x}}, \caption{... \label{y}} .... and then make the cross-reference with \ref{x} as \ref{y}, just a with floats with only one figure. – Fran Nov 20 '15 at 18:09
0

Okay, it was a little more complicated than I thought. The hard part was getting the links go to the top of the images.

I should mention that the hyperlinks to figures 1-3 all actually link to figure 3. But so long as they are all on the same level, it doesn't matter. If you want to set a label, do it after the corresponding \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}

multifig

Intead of a tabular, one could put each image/caption into a separate parbox and pack them together with \hfill or \hfil.

John Kormylo
  • 79,712
  • 3
  • 50
  • 120