I am writing a manuscript and I am using the subfloat package to include in a figure several figures, if I don't include a caption it compiles nicely, but when including the caption I get the error

! Improper \prevdepth.

I have tried using the caption package too but doesn't seem to work.
What I have looks like:



\hline \hline
First Column & Second column \\[1ex]

 \includegraphics[width=0.45\textwidth]{figure1} &\includegraphics[width=0.45\textwidth]{figure2} \\[0.5ex]

\hline \hline
}\caption{Caption for figures 1 and 2}\label{fig1and2}


If someone can comment on this I will really appreciate it. Thanks,

  • Your code compiles without problems on my TeXLive 2014 installation – user31729 Apr 6 '15 at 19:27
  • Remember to do \usepackage[caption=false]{subfig} with revtex4-1 – egreg Apr 6 '15 at 20:33
  • @egreg Thank you so much!! that does the trick, now it is working perfectly. – jealopez Apr 6 '15 at 20:41

Always call


with the revtex4-1 document class, which is not compatible with caption. The option is indeed meant not to load the caption package along with subfig (it will emulate the needed features).

Note that it's better avoiding blank lines inside \subfloat (not required, though). More importantly, you're missing some % and getting unwanted spaces:

\subfloat{% <----------- important
  \end{tabular}% <------ important

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.