I am using the AIP conference proceedings class file (aip-cp.cls) for writing a paper. I want to place two subfigures vertically, one below the other, using the subcaption package. The following is a code similar to what I had used :
\documentclass{aip-cp}
\usepackage{graphicx}
\usepackage{subcaption}
\graphicspath{{./Figures/}}
\begin{document}
\title{Test}
\begin{figure}
\captionsetup{type=figure}
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{ScatteringAmplitude.png}
\end{subfigure}\\
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{ScatteringAmplitude.png}
\end{subfigure}
\end{figure}
\end{document}
I used \captionsetup
in the above code because aip-cp class defines its own figure environment, and therefore the subcaption package does not recognize the figure as a floating environment as explained in an answer to this question.
The problem is that the two subfigures appear side by side despite of using \\
or \newline
. I do not face this problem when I use the article class however. I believe that the problem is in the aip-cp class, but as I am new to latex I don't know if it is possible to edit it to solve my problem.
The aip-cp class can be downloaded from here. I would appreciate if someone can go through the aip class file and let me know how to edit it. I am also happy with any alternate solution.
PS: I have also tried to use \subfloat
from the subfig package, but the output was still the same.
Best Answer
The class is definitely not compatible with
caption
(and so alsosubcaption
). It also redefines thefigure
environment in such a way that fools\subfloat
fromsubfig
into thinking that it is not in a floating environment.Here's a suggestion for making
subfig
work, but I'd not be surprised if the copy editor of your submission will not be happy with it.