I've been writing a document using the basic "article" class, but now I need to change it to "aastex." When I do this, my subfigures do not work. Is there any way aastex allows subfigures?
I tried to keep my original document as bare-bones as possible, so I'm pretty sure caption and subcaption were the only packages I included for this.
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{fig1.pdf}
\caption{Caption 1}
\label{fig:fig1}
\end{subfigure}%
\quad
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{fig2.pdf}
\caption{Caption 2}
\label{fig:fig2}
\end{subfigure}
\caption{Side-by-side figures.}
\label{fig:figures}
\end{figure}
Best Answer
First of all, let's see what a regular figure looks like under
aastex
:Note the use of
\figcaption
for the caption of a figure. The document class sets the caption flush left (fully justified). Now, let's look at usingcaption
and/orsubcaption
:Letting
\captionbox
to\relax
makescaption
work withaastex
(so it's a requirement). Then, we set the[figure]
options to ignore asinglelinecheck
- this sets the figure to be as wide as\linewidth
regardless of the caption width. Also, aspace
is added aslabelsep
. We also reset thejustification
to\centering
for[subfigures]
, as they inherit whatever is specified for[figure]
.Of course, one can also fake it using
tabular
s (losing some of the cross-referencing functionality):