[Tex/LaTex] REVTeX 4.1 + fixltx2e + includegraphics = doesn’t work

errorsrevtex

I use MacOSX Leopard and TeXShop. This piece of code works:

\documentclass[preprint,floatfix]{revtex4-1}
\usepackage{graphicx}
\begin{document}

\title{empty}

\section{fixltx2e or REVTeX 4.1 problem or mine?}

\begin{figure}[htb]
\centering
\includegraphics[width=0.5\textwidth]{fig1.pdf}
\caption{Awesome Image}
\label{fig:awesome_image}
\end{figure}

\end{document}

But if I load fixltx2e, the same piece of code it DOESN'T work!

\documentclass[preprint,floatfix]{revtex4-1}
\usepackage{fixltx2e}
\usepackage{graphicx}
\begin{document}

\title{empty}

\section{fixltx2e or REVTeX 4.1 problem or mine?}

\begin{figure}[htb]
\centering
\includegraphics[width=0.5\textwidth]{fig1.pdf}
\caption{Awesome Image}
\label{fig:awesome_image}
\end{figure}

\end{document}

This is the error that is produced:

<fig1.pdf, id=1, 61.25pt x 74.7pt> <use fig1.pdf>
No file test3.bbl.
[1{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
! Missing number, treated as zero.
<to be read again> 
\aftergroup 
l.20 \end{document}

Any idea how to fix this?

Best Answer

You can compile it if you load fixltx2e before the class. In that case you need \RequirePackage since \usepackage cannot be used before \documentclass.

\RequirePackage{fixltx2e}
\documentclass[preprint,floatfix]{revtex4-1}