I have 2 plots which in turn have 4 plots each, which I label as shown in the MWE. I am trying to get the caption of the figure to read:
Figure 1: (a)-(d) XYZ and (e)-(h) PQR
In the MWE I am doing it manually. How do I provide sub-references for all the figures such that I get the caption shown above? I cannot get \subref{fig_top_1,fig_top_2,fig_top_3,fig_top_4}
to generate the desired. How can I get multiple sub-references to appear as a range in the caption (as above)?
MWE
\documentclass[a4paper,twoside,12pt]{article}
\usepackage{graphicx,float}
\usepackage[subrefformat=parens,labelformat=parens]{subfig}
\usepackage{cleveref}
\begin{document}
\begin{figure}[H]
\centering
\subfloat{\label{fig_top_1}}
\subfloat{\label{fig_top_2}}
\subfloat{\label{fig_top_3}}
\subfloat{\label{fig_top_4}}
\includegraphics[width=70mm]{example-image-a}
\subfloat{\label{fig_bottom_1}}
\subfloat{\label{fig_bottom_2}}
\subfloat{\label{fig_bottom_3}}
\subfloat{\label{fig_bottom_4}}
\includegraphics[width=70mm]{example-image-b}
\caption{\protect\subref{fig_top_1,fig_top_2,fig_top_3,fig_top_4} XYZ
and \protect\subref{fig_bottom_1}--\subref{fig_bottom_4} PQR}
\label{fig_top_bottom}
\end{figure}
\end{document}