7

I am trying to add 9 figures in the middle of the page in a two column paper so that the caption of the figures appears in a two column style so that the paper looks something like this

enter image description here

This is the code I am using before adding the figures

%%
%% Beginning of file 'sample.tex'
%%
%%  2007 September
%%
%% This is a sample manuscript marked up using the
%% AASTeX v5.x LaTeX 2e macros.
%%  mimicing ASTR journal style
\documentclass{aastex}
\usepackage{spr-astr-addons}
\usepackage{url}\urlstyle{rm}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}


\RequirePackage{color}
\def\imagei{\centerline{\color[gray]{.75}\rule{\hsize}{4pc}}}%
\def\imageii{\centerline{\color[gray]{.75}\rule{4pc}{4pc}}}%



\begin{document}

\title{Title}


\begin{abstract}

\begin{description}

\item[PACS numbers] 04.50.Kd, 04.20.-q, 04.25.Nx
\end{description}

\end{abstract}


\keywords{Keywords}

\section{Intro}




\section{Conclusion}


\end{document}

%%
%% End of file `sample.tex'.

Does anyone know how to add the figures so they look like the image above.

Thanks

  • Please indicate which version of the aastex document class you use. (It doesn't appear to be the latest version, i.e., version 6.1, as that document class isn't compatible with some of the other LaTeX packages you load.) – Mico Oct 21 '16 at 13:07
  • @Mico, I don't know how to check the version of aastex. I am new to latex. Is there a way to check it? – MrDi Oct 21 '16 at 13:15
  • This image shown is simply one figure* containing 9 subfigures. Note, there is no standard subfigure, but I recommend the subcaption package. – John Kormylo Oct 21 '16 at 13:17
  • @JohnKormylo, but how are they arranged in this way? – MrDi Oct 21 '16 at 13:18
  • 1
    it is offtopic: but who in the world thought a two-column caption would be a good idea? It is SUPPOSED to break the flow of the two-column text because it belongs to the figure that does so as well. – Bort Oct 21 '16 at 15:05
2

Adapting my answer to Is it possible to have a two-column figure caption in revtex?

\documentclass{aastex}
%\usepackage{spr-astr-addons} % I haven't it

\usepackage{url}\urlstyle{rm}
\usepackage{graphicx}
\usepackage{color}
\usepackage[caption=false]{subfig}

\usepackage{lipsum}

\captionsetup[subfigure]{position=top}

\makeatletter
\newcommand{\twocolumncaption}{\@dblarg\@twocolumncaption}
\def\@twocolumncaption[#1]#2{%
  \renewcommand{\@makecaption}[2]{%
    \par\vskip\abovecaptionskip\begingroup\small\rmfamily
    \splittopskip=0pt
    \setbox\@tempboxa=\vbox{
      \@arrayparboxrestore \let \\\@normalcr
      \hsize=.5\hsize \advance\hsize-1em
      \let\\\heading@cr
      \noindent ##1\ ##2\par% this line for aastex
    }%
    \vbadness=10000
    \setbox\z@=\vsplit\@tempboxa to .55\ht\@tempboxa
    \setbox\z@=\vtop{\hrule height 0pt \unvbox\z@}
    \setbox\tw@=\vtop{\hrule height 0pt \unvbox\@tempboxa}
    \noindent\box\z@\hfill\box\tw@\par
    \endgroup\vskip \belowcaptionskip
  }%
  \setlength{\abovecaptionskip}{4ex}%
  \caption[#1]{#2}%
}
\makeatother



\begin{document}

\title{Title}
\author{A. Uthor}
\affil{Somewhere}

\begin{abstract}

\lipsum[2]

\begin{description}

\item[PACS numbers] 04.50.Kd, 04.20.-q, 04.25.Nx
\end{description}

\end{abstract}


\keywords{Keywords}

\maketitle

\section{Intro}

\lipsum[1-3]

\begin{figure*}
\centering

\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}\ 
\subfloat[]{\includegraphics[width=0.25\textwidth]{example-image}}

\twocolumncaption{%
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, 
nonummy eget, consectetuer id, vulputate  a, magna. Donec vehicula augue eu neque. 
Pellentesque habitant morbi  tristique senectus et netus et malesuada fames ac turpis 
egestas. Mauris  ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum 
urna  fringilla.}

\end{figure*}

\lipsum

\section{Conclusion}

\lipsum

\end{document}

enter image description here

If the Springer style already makes the two column caption, remove the code from \makeatletter to \makeatother (included) and just use \caption.

  • Thank you this is very helpful but is there a way to control to horizontal spacing between each figure? – MrDi Oct 21 '16 at 17:25
  • @MrDi I used \ (backslash-space); you can use \quad or any other spacing command. – egreg Oct 21 '16 at 17:27
5

Using the caption package one can declare a new format. Without the caption package you can simply put the caption into multicols.

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage{blindtext}% MWE only

\DeclareCaptionFormat{twocolumn}{\begin{multicols}{2}#1#2#3\end{multicols}}

\begin{document}
\begin{figure*}
\centering
\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}\hfil
\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}\hfil
\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}

\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}\hfil
\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}\hfil
\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}

\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}\hfil
\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}\hfil
\begin{subfigure}{0.3\textwidth}
\caption{}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}

\captionsetup{singlelinecheck=false,format=twocolumn}%
\caption[short caption]{\blindtext}
\end{figure*}
\end{document}

demo

  • Simple and nice solution! (+1) – Zarko Oct 21 '16 at 21:31
4

Using \documentclass{article}, it is simple to obtain the following:

enter image description here

\documentclass[12pt,twocolumn]{article}
\usepackage[a4paper]{geometry}
\usepackage[font=small, labelfont=bf]{caption}
\usepackage{subcaption}
\usepackage{graphicx}

\begin{document}
\begin{figure*}[htb]
\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-a}% width
    \label{fig:myfig-a}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-b}% width
    \label{fig:myfig-b}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-c}% width
    \label{fig:myfig-c}
\end{subfigure}

\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-a}% width
    \label{fig:myfig-d}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-b}% width
    \label{fig:myfig-e}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-c}% width
    \label{fig:myfig-f}
\end{subfigure}

\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-a}% width
    \label{fig:myfig-g}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-b}% width
    \label{fig:myfig-h}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \caption{}
\includegraphics[width=\linewidth]{example-image-c}% width
    \label{fig:myfig-i}
\end{subfigure}

\caption{My figures}
    \end{figure*}
\end{document}

Unfortunately I haven't your document class and consequently if it have some issues with used packages.

  • Thank you this works fine. Is there a way to make the caption appear in a two column style just like in image in the question? – MrDi Oct 21 '16 at 13:29
  • Also is there a way so that when you change .3\textwidth to .2\textwidth the figures remain in centre of the page? – MrDi Oct 21 '16 at 13:36
  • Centering is independent to image size (theirs with only should be smaller than \textwidth/3. Regarding two column caption you already have one answer from John Kormylo. I will look for an alternative solution. – Zarko Oct 21 '16 at 14:02
  • for two column caption see ex.stackexchange.com/questions/226950/is-it-possible-to-have-a-two-column-figure-caption-in-revtex is this acceptable for you. – Zarko Oct 21 '16 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.