Let say you have three figures respectively on pages 1, 2 and 3. The use of the command
\cpageref{figure1,figure2,figure3}
will yield
pages 1, 2 and 3
However the use of the command
\cpagerefrange{figure1}{figure3}
will yield
pages 1 to 3
NOTE: These two commands are part of the cleveref
package.
Something very odd seems to be going on in your document, as cleveref
does not normally engage in the type of behavior you say is occurring. How are the figures and subfigures constructed in your document? Please consider posting a full MWE (minimum working example) that generates the problem behavior you're looking to fix.
At any rate, the following should work for your setup:
\cref{5-3-b,,5-3-d,,5-3-f,,5-4-b,,5-4-d,,5-5-b,,5-5-d}
See section 5, entitled "Sorting and compressing", of the package's user guide for an explanation of how the double comma constructs work.
Here's an MWE (minimum working example), which demonstrates that both \cref{5-3-b,5-3-d,5-3-f,5-4-b,5-4-d,5-5-b,5-5-d}
and \cref{5-3-b,,5-3-d,,5-3-f,,5-4-b,,5-4-d,,5-5-b,,5-5-d}
produce the same output if normal setup rules are obeyed.
\documentclass{article}
\usepackage{subcaption} % for 'subfigure' environment and counter
\usepackage[colorlinks,allcolors=blue]{hyperref} % optional
\usepackage[noabbrev]{cleveref}
\counterwithin{figure}{section}
\begin{document}
\setcounter{section}{5}
\setcounter{figure}{2}
\cref{5-3-b,5-3-d,5-3-f,5-4-b,5-4-d,5-5-b,5-5-d}
\cref{5-3-b,,5-3-d,,5-3-f,,5-4-b,,5-4-d,,5-5-b,,5-5-d}
% the following code is deliberately minimalist
\refstepcounter{figure}
\refstepcounter{subfigure}
\refstepcounter{subfigure}\label{5-3-b}
\refstepcounter{subfigure}
\refstepcounter{subfigure}\label{5-3-d}
\refstepcounter{subfigure}
\refstepcounter{subfigure}\label{5-3-f}
\refstepcounter{figure}
\refstepcounter{subfigure}
\refstepcounter{subfigure}\label{5-4-b}
\refstepcounter{subfigure}
\refstepcounter{subfigure}\label{5-4-d}
\refstepcounter{figure}
\refstepcounter{subfigure}
\refstepcounter{subfigure}\label{5-5-b}
\refstepcounter{subfigure}
\refstepcounter{subfigure}\label{5-5-d}
\end{document}
Best Answer
Omit the space after the comma.