# Caption automatically centered in a REVTeX document

I'm recently writing an APS paper with REVTeX and encountered a problem. The captions in all figure and table floats are automatically centered instead of being fully justified. I tried \captionsetup but there are only options like raggedright or raggedleft. Can anyone tell me what I was missing? The following is the header of my document:

\documentclass[aps,prl,reprint,twocolumn,amsmath,amssymb,groupedaddress]{revtex4-1}

\usepackage[dvipdfm]{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}


A typical figure environment is as follows:

\begin{figure}[h]
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\textwidth]{FIG11.eps}
\label{fig:FIG11}
\end{subfigure}~
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\textwidth]{FIG12.eps}
\label{fig:FIG12}
\end{subfigure}
\caption{Gate control when large magnitude control is allowed. (a) Z-gate control in Lorentzian-like environment. (b) Identity-gate control in Ohmic environment. Here $\epsilon(t)\leq20\omega_{0}$. }
\label{fig: large control}
\end{figure}


The strange thing is that there is a sample "apssamp.tex" in the REVTeX zip file provided by APS. I copy my figure environment and paste it into the sample file and the caption is fully justified. But if I copy a figure environment in the sample and paste it to my own tex file, I always get centered caption. That's why I suspect that the problem should be due to the header.

• Welcome to TeX.SX! You might have a look on our our starter page if you wish to familiarize yourself further with our format. Sep 30, 2013 at 7:38
• I don't think the pre is where the problem is - we should see you figure environment as well. I can confirm that it doesn't do that for me. Sep 30, 2013 at 9:57
• As far as I know, caption is not compatible with revtex4-1. For subfloats, I think \usepackage[caption=false]{subfig} is better. Sep 30, 2013 at 15:19
• @egreg, good spot - I've never used RevTeX for anything where subfigures are accepted. Sep 30, 2013 at 15:43
• Thanks for your comment. I tried the template again with the subfigure package and got what I want. Although I'm still not clear what exactly caused the trouble in my original code but it's all settled now. Thanks a lot! Oct 1, 2013 at 8:31

The caption package is not compatible with revtex4-1; you can still add captioned subfloats with

\usepackage[caption=false]{subfig}


in the preamble and a syntax such as

\subfloat[]{\label{fig:FIG11}%
\includegraphics[width=0.24\textwidth]{FIG11.eps}%
}


In the optional argument of \subfloat you can supply also a subcaption; if empty, only the markers (a) (b) and so on will appear.

• This should be the accepted answer. Feb 28, 2018 at 6:34