Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
The problem comes from the \@addtocurcol defined in fixltx2e.sty. Perhaps someone can detect the cause. –  Gonzalo Medina Sep 8 '11 at 18:30

1 Answer 1

up vote 3 down vote accepted

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}
share|improve this answer
    
This receipt has helped me to solve another trouble with RevTeX+figure. figure did not work for me if I tried to compile my document using XeTeX or LuaTeX. A maintainer of RevTeX answered me that they do not support XeTeX/LuaTeX (sic!). It would be interesting to understand why \RequirePackage{fixltx2e} makes a remedy for the problem with figure environment in RevTeX class. Note that RevTeX uses its own mechanism of placing floats which evidently fails under (Xe/Lua)TeX. –  Igor Kotelnikov Feb 8 '13 at 5:24
    
@IgorKotelnikov pdfLaTeX also encounters this problem. –  Ch'en Meng Nov 20 at 12:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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