# two figures side by side with each a caption using memoir

i tried to use the answer of a previous question and can put two figures side by side. when I try to put a caption on each of them, only the second figure appears.

Example code with the caption lines commented out (replace figure to run!)

\documentclass[msmallroyalvopaper
]{memoir}

\usepackage{graphicx}
\newsubfloat{figure}

\begin{document}

text

\begin{figure}
\centering
\subbottom{
\begin{minipage}[c]{0.45\textwidth}
\includegraphics[width=0.95\textwidth]{figures/c29}
\end{minipage}
%       \caption{Necker Cube\index{Necker Cube}: A cube or a corner?}
\label{fig:2.9}
}
\subbottom{
\begin{minipage}[c]{0.45\textwidth}
\includegraphics[width=0.95\textwidth]{figures/c210}
\end{minipage}
%           \caption{Two Faces or a Vase?}
\label{fig:2.10}
}
\end{figure}

more text

\end{document}


how to arrange with two captions?

• Why are you using \subbottomk in the first place? Just add \caption + \label into the min minipages. Good idea to also add \centering into the minipages and change [width=0.95\textwidth] to [width=0.95\linewidth]. TIP: if you give graphicx the package option demo it ignores all images and make blaqck square sample images instead – daleif Jun 12 '18 at 9:36

I wondered if memoir was one of the class/packages which moved captions around (like floatrow). As it turned out, not a problem. Since I had already done the work...

The default for figure (IIRC) is [tbp], which is why the float was moved to the top of the page.

\documentclass[msmallroyalvopaper
]{memoir}

\usepackage{graphicx}

\begin{document}

text

\begin{figure}
\begin{minipage}[c]{0.45\textwidth}
\centering
\includegraphics[width=0.95\textwidth]{example-image-a}
\caption{Necker Cube\index{Necker Cube}: A cube or a corner?}
\label{fig:2.9}
\end{minipage}\hfill
\begin{minipage}[c]{0.45\textwidth}
\centering
\includegraphics[width=0.95\textwidth]{example-image-b}
\caption{Two Faces or a Vase?}
\label{fig:2.10}
\end{minipage}
\end{figure}

more text

\end{document}