1

Using {ieee}[2000/01/11].cls (via Formatting IEEE Papers in LaTeX2e), I have a problem with the following minimal code (which builds fine for \documentclass{article} - using pdflatex to compile):

\documentclass[%
        %draft,
        %submission,
        %compressed,
        %final,
        %
        %technote,
        %internal,
        %submitted,
        %inpress,
        %reprint,
        %
        %titlepage,
        notitlepage,
        %anonymous,
        narroweqnarray,
        inline,
        %twoside,
        ]{ieee}
% \documentclass{article}

\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{cite}
\usepackage{caption}

\begin{document}

Test ...

\begin{figure}
\end{figure}

\end{document}

It fails with:

! Too many }'s.
\color@endbox ->\color@endgroup \egroup 

l.33 \end{figure}

? X
No pages of output.
Transcript written on test.log.

This error is discussed in LaTeX Community • View topic - color package incompatible with figures?, and indeed, ieee.cls does define \@xfloat - but I'm trying the following things:

\makeatletter

% \undef\@xfloat % no work :) 

% http://joonidea.blogspot.com/2010/04/how-to-undefine-command-in-latex.html
% \let\@xfloat\@undefined                  % undefine \@xfloat
% no work, fails with:
%% ! Undefined control sequence.
%% \@xfloat #1[#2]->\caption@ORI@xfloat 
%%                                      {#1}[#2]\caption@settype {#1}
%% l.49 \end
%%          {figure}

% http://www.latex-community.org/forum/viewtopic.php?f=4&t=507&p=1978
% the below has no effect: 
% \let\latex@xfloat=\@xfloat
% \def\@xfloat #1[#2]{%
%   \latex@xfloat #1[#2]%
%   \def \baselinestretch {1}\@normalsize  %%  GT: need \@normalsize?
%   \normalsize
% }

\makeatother

... but obviously, cannot get it to work.

Is it somehow possible to have \figure with this {ieee}[2000/01/11] class, such that I override its behavior in the tex file, instead of hacking the .cls file?

Many thanks in advance for any answers,
Cheers!

sdaau
  • 17,079
  • 3
    The ieee class is ancient. You really should be using the current IEEEtran class. – Joseph Wright Sep 19 '11 at 19:33
  • Thanks for confirming that @Joseph Wright - I will try to modify my document towards IEEEtran; but I'd still be interested in an answer to the OP, in case it turns out people insist on the "old" layout... Cheers! – sdaau Sep 19 '11 at 19:36
  • Just a note on IEEEtran: ieee.cls commands like \authorinfo or \journal are not present in IEEEtran, which also ignores the \documentclass[...] arguments as given above (and insists on twocolumn layout). – sdaau Sep 19 '11 at 19:45
  • 1
    @sdaau : actually it doesn't. It has many capabilities and you can check the extensive documentation. You can use for example \documentclass[12pt,onecolumn]{IEEEtran}. Moreover, as far as I know, all IEEE journals are converted to IEEEtran class maybe except the IEEE computer society and other few journals. So whoever is forcing IEEE.cls, simply does not follow IEEE regulations. – percusse Sep 19 '11 at 20:28
  • Many thanks for the clarification, @percusse - sorry for using imprecise wording, I merely wanted to emphasize different behavior between packages; also nice to know I shouldn't expect the old ieee.cls to be forced! Cheers! – sdaau Sep 19 '11 at 20:37
  • @sdaau No problem at all. I just wanted to let you know that days of ieee.cls has passed and you shouldn't spend your precious effort on obsolete tools. – percusse Sep 19 '11 at 20:46

1 Answers1

3

I tried with

\makeatletter
\let\kernel@xfloat\@xfloat
\makeatother
\documentclass[...]{ieee}

\makeatletter
\let\@xfloat\kernel@xfloat
\def\@floatboxreset{%   
  \reset@font
  \linespread{1}\normalsize
  \@setminipage}
\makeatother   

and the result seems to be the desired one. I believe that the problem lies in a very old definition of \@xfloat that is incompatible with the way LaTeX normally works with floats.

Using a class that is based on a LaTeX 2.09 document style along with much more modern packages leaves the door open for inconvenients, as you've discovered.

egreg
  • 1,121,712
  • Yippie !! :) Awesome - many thanks for the solution, @egreg; a true life-saver this time :) Cheers! – sdaau Sep 19 '11 at 19:52