Dumthe subfigure label without changing anything to the caption formatting

cleverefsubcaption

I want to use cleveref to reference to panels inside a figure. Thereby I design the entire figure outside LaTeX with labels a, b, … for the different panels. To this end I need some dummy subfigures with labels. So what I did was:

\documentclass[prl,twocolumn]{revtex4-2}

\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{cleveref}

\begin{document}
\maketitle

See \cref{fig:1:a}

\begin{figure}
    \begin{subfigure}{\textwidth} % this 'subfigure' env. has no visible content
        \refstepcounter{subfigure}\label{fig:1:a}
        \refstepcounter{subfigure}\label{fig:1:b}
    \end{subfigure}%
    \centering
    \includegraphics[width=.5\textwidth]{example-image}
    \caption{(a) First sub caption. (b) Second sub caption. And some more text}
    \label{fig:1}
\end{figure}

\end{document}

Which gives (zoom):

enter image description here

The problem is however that subcaption changes the formatting of the caption. For completeness, without the subfigure and without including subcaption the caption looked like this (zoom):

enter image description here

Since I do not use the subcaptions for anythings else then a dummy label I do not want to change the formatting of the my caption at all.

So my question is simple: How do I get dummy subcaption labels without the subcaption package?

Best Answer

Option (1) Use \captionsetup[figure]{...} to get back the right format.

d

    \documentclass[prl,twocolumn]{revtex4-2}

\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{cleveref}

\captionsetup[figure]{textfont=normalfont,singlelinecheck=off,justification=raggedright}% added <<<

\usepackage{kantlipsum}
\begin{document}
    \maketitle
    
    See \cref{fig:1a}
    
    \begin{figure}[ht]
        \begin{subfigure}{\textwidth} % this 'subfigure' env. has no visible content
            \refstepcounter{subfigure}\label{fig:1a}
            \refstepcounter{subfigure}\label{fig:1b}
        \end{subfigure}%
        \centering
        \includegraphics[width=\linewidth]{example-image}% use linewidth <<<
        %\caption{(a) First sub caption. (b) Second sub caption. And some more text}
            \caption{ (\protect\subref{fig:1a}) First sub caption.  (\protect\subref{fig:1b}) Second sub caption. And some more text}
        \label{fig:1}
    \end{figure}

    \kant[1-7]
\end{document}

or (2) Instead of subcaption it can be used subfig. (See the use of \subref{..} in the example)

c

\documentclass[prl,twocolumn]{revtex4-2}

\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}
\usepackage{cleveref}

\usepackage{kantlipsum}

\captionsetup[figure]{textfont=normalfont,singlelinecheck=off,justification=raggedright}

\begin{document}
    \maketitle
    
    See \cref{fig:1a} and  subfigure~\subref{fig:1b}.   
    \begin{figure}[ht!]
        \subfloat{\label{fig:1a}}
        \subfloat{\label{fig:1b}}
        \centering
        \includegraphics[width=\linewidth]{FigureOne.pdf}
        \caption{ \protect\subref{fig:1a} First sub caption.  \protect\subref{fig:1b} Second sub caption. And some more text}
       \label{fig:1}
    \end{figure}
    
    \kant[1-7]
\end{document}

The FigureOne.pdf was generated by this file.

%%file FigureOne.tex

\documentclass[preview, border=5pt]{standalone}
\usepackage{geometry}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}
    
    \begin{figure}
    \centering
    \subfloat[][]{\includegraphics[width=0.5\textwidth]{example-image-a}}\enspace
    \subfloat[][]{\includegraphics[width=0.5\textwidth]{example-image-b}}
\end{figure}    
\end{document}
Related Question