I'm using the cleveref
package to reference floats (in this case subfigures) in the memoir
class. Currently the output looks like this (sorry for the danish, I don't think it matters):
Using the following input (not all packages included, ofc):
\documentclass[oneside,article,12pt,danish]{memoir}
\usepackage{graphicx}
\newsubfloat{figure}
\captiontitlefont{\slshape}
\subcaptionfont{\slshape}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\begin{figure}[h!]
\centering
\subbottom[Subfigure 1 caption]{\rule{3cm}{1cm}\label{sub1}}
\hspace{1cm}
\subbottom[Subfigure 2 caption]{\rule{3cm}{1cm}\label{sub2}}
\caption{Figure text.}
\label{fig:secondfig}
\end{figure}
\cref{sub1,sub2}
\end{document}
I like the way the figure/subfigures are set up, but I would like the reference to say 5a
or 5.a
instead of 5(a)
without changing the figure/subfigure captions. Is there a general way to do this in the entire document, so that it can be easilly be changed to a somewhat random notation?
Best Answer
This solution avoids the need to load
caption
and thereby retains the facilities ofmemoir
. At least, it seems so although my testing has been somewhat minimal. Uncomment/comment the appropriate line to achieve formatting with or without the dot, as the mood takes you.Were you to load
xcolor
then you could (perversely) have just the references to the sub-figure bits typeset in huge, blue lowercase without affecting the captions or other references:Obviously, this would be a terrible choice but it demonstrates that the format can be easily 'changed to a somewhat random notation' while retaining the format of sub-captions and the interface of
memoir
.