# subfigures with memoir

I switched to memoir and stopped including subfig and now all my subfigures interpret the caption as actual text, i.e., "[caption...]" shows up in the document with the square brackets. How do I have captioned subfigures with memoir?

-

Use

\newsubfloat{<float>}


to activate

\subbottom
\subtop


inside environments.

-
I'm sorry, I don't think I know how to use it. It says 'no counter "<float>" defined' –  Neil G Aug 6 '10 at 7:59
\newsubfloat{figure} if you want to use \subtop or \subbottom inside a figure environment. \newsubfloat{table} for tables. –  Leo Liu Aug 6 '10 at 8:14

In addition to Marin's answer, if you also want to use cleveref with memoir, I have found sub figures can not be properly referenced unless loading subfig. Here is what I do:

\RequirePackage[caption=false,position=top]{subfig}
\let\subtop\subfloat


so that I can continue using \subtop and if one day I decide to drop subfig my document needs no change.

A full example can look like this:

\begin{figure}
\subtop[1 pass]{\includegraphics{eye1}}%
\subtop[5 passes]{\includegraphics{eye5}}%
\caption{loop performance comparison}
\label{fig:eye-comparison}
\end{figure}

-
how do you add captions? –  Neil G Aug 6 '10 at 8:04
For sub captions: \subtop[caption]{\includegraphics{fig1}} –  Leo Liu Aug 6 '10 at 8:11
Thanks! I wasn't able to include subfig though: ! Missing \endcsname inserted. <to be read again> \@classoptionslist l.297 \ProcessPackageOptions –  Neil G Aug 6 '10 at 8:15
I added an example. –  Leo Liu Aug 6 '10 at 8:37
Thanks, it works, but I get this weird warning: pdfTeX warning (ext4): destination with the same identifier (name{subfigure.2}) has been already used, duplicate ignored Any ideas? –  Neil G Aug 6 '10 at 8:42