Unfortunately the combination of memoir
, caption
, and hyperref
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".
\documentclass{memoir}
\usepackage{caption,hyperref}
\begin{document}
A
\end{document}
causes
Package caption Info: Incompatible package detected (regarding \caption).
(caption) \caption = \long macro:->\donemaincaptiontrue \m@moldhypcaption .
Package caption Warning: \caption will not be redefined since it's already
(caption) redefined by a document class or package which is
(caption) unknown to the caption package.
See the caption package documentation for explanation.
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:
- I will add the redefinition of the memhfixc package to the database of my caption package. This will stop the caption package from operating in compatibility mode.
- I will ask the current maintainer of the memoir document class if any further adoption is necessary.
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
\let\subcaption\undefined
\let\subfloat\undefined
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 the memoir
document class. I'll release it with the upcoming version 3.3 of the caption
package.
This is quite an unusual request/demand. Here is one solution, but it probably will make a mess at normal use of figure referencing:
\documentclass{memoir}
\usepackage{hyperref}
\usepackage[capitalise]{cleveref}
\newsubfloat{figure}
\renewcommand{\thesubfigure}{Fig.~\arabic{figure}\alph{subfigure}}
\crefformat{subfigure}{#2#1#3}
\begin{document}
\begin{figure}[h]\centering
\renewcommand{\thefigure}{}
\subbottom[first subfigure \label{fig:1}]{\fbox{figure numero uno}}
\hfil
\subbottom[second subfigure \label{fig:2}]{\fbox{figure numero dos}}
\stepcounter{figure}
\end{figure}
some text
\begin{figure}[h]\centering
\renewcommand{\thefigure}{}
\subbottom[first subfigure \label{fig:3}]{\fbox{figure numero uno}}
\hfil
\subbottom[second subfigure \label{fig:4}]{\fbox{figure numero dos}}
\stepcounter{figure}
\end{figure}
some text
\begin{figure}[h]\centering
\fbox{some "normal" figure}
\caption{normal figure}
\label{fig:5}
\end{figure}
\cref{fig:1} and \cref{fig:4} and also \cref{fig:5}
\end{document}

Edit:
Desired look-out is achieved by use \renewcommand{\thefigure}{}
in each float with subfigures and \stepcounter{figure}
before end of figure
float. Now I hope is fulfilled your requests.
Best Answer
The
subfig
andsubcaption
packages can not be used in cooperation with each other. Instead, you can usecaption
package withsubfig
to add some flavor to the captions and subcaptions (or you can usecaption
along withsubcaption
(which gives a subfigure command also).