This is similar to this question about using subfigures in memoir class and this one about using subfigure memoir and hyperref together
Is it possible to use memoir class with sucaption package?
I tried dissemulating the ccaption
packages but it doesn't work.
\DisemulatePackage{ccaption}
\documentclass[a4paper,12pt,fleqn,openany]{memoir}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}[b]{.5\linewidth}
\centering\large A
\caption{A subfigure}\label{fig:1a}
\end{subfigure}%
\begin{subfigure}[b]{.5\linewidth}
\centering\large B
\caption{Another subfigure}\label{fig:1b}
\end{subfigure}
\caption{A figure}\label{fig:1}
\end{figure}
\end{document}
I get the following error
LaTeX Error: Command \subcaption already defined.
LaTeX Error: Command \subfloat already defined.
any ideas?
Update
This doesn't work with hyperref
… Adding
\usepackage{hyperref}
leads to compilation errors.
So the new question is, is it possible to use memoir class with sucaption and hyperref packages? Are the 3 packages compatible?
Best Answer
Unfortunately the combination of
memoir
,caption
, andhyperref
is not fully compatible. (Not true anymore, see Addendum 2011-10-12.)When the memoir document class detects the caption package it will re-define some macros to full-feed the needs of the caption package; so this combination works fine alone. But when you load the hyperref package, the memoir class loads the memhfixc package additionally which redefines
\caption
which makes the caption package to enter the fall-back or so called "compatibility mode".causes
The subcaption package does not work well in "compatibility mode", causing it to behave strange. (The very next version will issue an error message instead.)
My proposal:
So hopefully this issue will be fixed very soon.
P.S.: Sorry for the late answer
Addendum 2011-10-12
A new version of the caption package bundle is finally available on CTAN and as TeXlive update which fixes the hyperref compatibility issue. But one still needs
before loading the subcaption package since the memoir document class is not adapted to the subcaption package (yet).
Addendum 2012-04-10
Finally I have found some time to take a closer look at this issue, and it seems that I was able to adapt the
subcaption
package for usage with thememoir
document class. I'll release it with the upcoming version 3.3 of thecaption
package.