I am using memoir and cleveref with the sort&compress keyword (that I assumed was default actually). When referencing multiple subfigures with one \Cref command, there are not ranges given. Taken from the MWE below, it says "Figures 0.1(a) and 0.1(b)" but I would like to have "Figures 0.1(a-b)", "Figures 0.1(a)-(b)" or "Figures 0.1(a) and (b)". (All of these are acceptable in case one is more difficult to produce.)
Question: How do I get automatically the second format, i.e. avoid the repetition of the main figure number automatically?
EDIT: Note that this question Combining cleveref and subref is about manually referencing a sub figure. I would only like to have the main figure number not repeated automatically.
MWE:
\documentclass{memoir} \usepackage{varioref} \usepackage[ hidelinks, breaklinks=true, bookmarksnumbered=true, pdfpagemode=UseOutlines ]{hyperref} \usepackage[ nameinlink, sort&compress, % not working? ]{cleveref} \usepackage{nameref} \newsubfloat{figure}% Allow subfloats in figure environment \begin{document} \begin{figure} \centering \subbottom{\label{sub-I}random subfigure content I} \subbottom{\label{sub-II}random subfigure content II} \caption{random caption text} \end{figure} \Cref{sub-I,sub-II} \end{document}
sort&compressoptions seems to compress only, if there are three ore more items cited. For information on how to enable the compressing for two or more subfigures, see here: tex.stackexchange.com/q/114957/134144. Information on how to get rid of the repeated 'main figure number' can be fond here: tex.stackexchange.com/q/333223/134144.\Crefcommand)?