0

I'm trying to submit a document to PRA, and having some issues with the latex file. I have to begin using this revtex4 document class:

\documentclass[aps,pra,twocolumn,english]{revtex4}

and I would like to be able to \usepackage{subcaption}, as I have multiple figures formatted like:

\begin{figure*}[tbh]
    \centering
    \begin{subfigure}{0.49\linewidth} \centering
        \includegraphics[width=\textwidth]{figures/cool.png}
        \caption{blah 1 \label{fig:thermalising}}
    \end{subfigure}
    \begin{subfigure}{0.49\linewidth} \centering
        \includegraphics[width=\textwidth]{figures/Qcool.png}
        \caption{blah 2 \label{fig:Qthermalising}}
    \end{subfigure}
    \caption{blahblahblah.}
    \label{fig:Qsched}
\end{figure*}

Ideally, my figure has two subfigures, each with a caption and letter associated to them ((a) and (b)), and then there's an overall caption.

However, when I try compile the file I get the error Package caption Error: The `subcaption' package does not work correctly(caption) in compatibility mode. \begin{document}. When I view the file all the sub-figures no longer have labels attached (i.e. (a), (b), etc)

How can I get the behaviour I would like, where subfigures with there own captions get a letter?

1
  • 1
    Please extend you example to something others can copy and compile as is, additionally please replace your images by say \rule{4cm}{4cm} as we don't have your images.
    – daleif
    Jul 30, 2021 at 11:46

1 Answer 1

1

Use \documentclass[aps,pra,twocolumn,english]{revtex4-2} instead of \documentclass[aps,pra,twocolumn,english]{revtex4}

a

\documentclass[aps,pra,twocolumn,english]{revtex4-2}

\usepackage{subcaption}

\usepackage{graphicx}

\begin{document}        
    
\begin{figure*}[tbh]
    \centering
    \begin{subfigure}{0.49\linewidth} 
        \includegraphics[width=\textwidth]{example-image-a}
        \caption{blah 1 \label{fig:thermalising}}
    \end{subfigure}\hfill
    \begin{subfigure}{0.49\linewidth} 
        \includegraphics[width=\textwidth]{example-image-b}
        \caption{blah 2 \label{fig:Qthermalising}}
    \end{subfigure}
    \caption{blahblahblah.}
    \label{fig:Qsched}
\end{figure*}   

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .