Graphics, Figures & TablesProblems with fixltx2e

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
rhysy
Posts: 6
Joined: Thu Aug 05, 2010 1:16 pm

Problems with fixltx2e

Post by rhysy »

Hi,

I'm preparing a 2-column document and some figures have to span the whole page, so I'm using figure* and table*. To prevent Latex numbering the figures in a weird way I'm trying to use fixltx2e. This is numbering them as I want, but also generates errors when compiling : specifically "! Extra }, or forgotten \endgroup." I do not think there are any wayward }'s, because if I take out the line \usepackage{fixltx2e} it compiles fine.

Also, if I ignore the errors and let it compile it puts the word "table" (or "figure") wherever the code is in the text. It actually generates the figures/tables correctly.

Here's some sample code, it's a paper for MNRAS - you can download the style and class file here : http://www.wiley.com/bw/static/mnras_latex.asp

Code: Select all

\documentclass[a4,useAMS,usenatbib,usegraphicx]{mn2e}
\usepackage{subfigure}
\usepackage{lscape}
\usepackage{natbib}
\usepackage{fixltx2e}
\bibliographystyle{abbrvnat}
\setlength{\parskip}{0pt}

\begin{document}

\begin{figure*}
\begin{center}
%\includegraphics[scale=0.5]{File}
\caption[Pretty picture]{Insert pretty picture of galaxies here}
\label{Thing}
\end{center}
\end{figure*}


\end{document}
Many thanks for any help,

Rhys
Last edited by rhysy on Mon Mar 14, 2011 7:01 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problems with fixltx2e

Post by localghost »

The subfigure package is the culprit. That's something you could have found out by yourself during the process of building a minimal working example (MWE). And since the mentioned package is obsolete you should drop or replace it [1].

As soon as the problem is solved, please act exactly according to Section 3 of the Board Rules (can be found on top each forum in the »announcements« section).

[1] View topic: Obsolete packages and document classes — Avoid usage!


Thorsten
rhysy
Posts: 6
Joined: Thu Aug 05, 2010 1:16 pm

Re: Problems with fixltx2e

Post by rhysy »

Well, I think it's working now... mostly. I replaced subfigure with subfig and changed all the \subfigure to \subfloat. It now compiles with a single errors \@makecaption undefined. This occurs on a blank line, weirdly. However as far as I can tell the dvi file produced is entirely correct, so I'll check through it some more and mark this as solved. Thanks !
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problems with fixltx2e

Post by localghost »

rhysy wrote:[…] I replaced subfigure with subfig and changed all the \subfigure to \subfloat. It now compiles with a single errors \@makecaption undefined. […]
That's something I can't confirm. Consider the following short example.

Code: Select all

\documentclass[useAMS,usenatbib,usegraphicx]{mn2e}
\usepackage{fixltx2e}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[caption=false]{subfig}
\bibliographystyle{abbrvnat}

\begin{document}
  \begin{figure*}
    \centering
    \rule{6.4cm}{3.6cm}
    \caption{Dummy figure}\label{fig:dummy}
  \end{figure*}
\end{document}
This compiles for me without any error but I get a (double) warning from the subfig package.

Code: Select all

Package subfig Warning: Your document class has a bad definition
 of \endfigure, most likely
 \let\endfigure=\end@float
 which has now been changed to
 \def\endfigure{\end@float}
 because otherwise subsequent changes to \end@float
 (like done by several packages changing float behaviour)
 can't take effect on \endfigure.
 Please complain to your document class author.
The last line says it all. The used document class in general seems to be problematic. Another proof for that is one more warning.

Code: Select all

Package epstopdf Warning: Drivers other than `pdftex.def' are not supported.
The reason for this is that internally the class uses the graphicx with the dvips option thus is only for use with LaTeX but not with PDFLaTeX. Nowadays a bad practice. But that doesn't astound since the class is a ten years old. This misbehaviour is worth an urgent note to the class maintainer. The class needs to be adapted to modern TeX systems.
Post Reply