I have to use the IEEE class file which can be found here:


There you can download the class file itself (ieee.cls) and a demo tex file called ieeecls.tex. When I load the pgfplots package then I get the following error

! Too many }'s. \color@endbox ->\color@endgroup \egroup l.811 \end{figure}

I saw that there are other posts regarding this problem, the best help is

Why do I get an error "Too many }'s" when using package rotating

in my opinion. It is anweserd by Stefan Kottwitz. The solution doesn't help in my case. The solution from Stefan is:

There are classes and style files, which define the macro \@xfloat in a way which can cause exactly this error. In this case, consider removing/redefining this macro, or using a different class

\def\@xfloat #1[#2]{%
  \latex@xfloat #1[#2]%

I cannot add a minimal working example here - but you can download the two files needed as decribed above.

I already filed a bug report to IEEE but I don't think they will reply in time.

  • Are you sure you don't want to use the ieeetran class included with most distributions instead? Jan 18 '15 at 20:57
  • @MikeRenfro: No I am not. The paper we want to apply for leads the the class fiel I mentioned in the question. But I can ask if I can also use the class you propose. But I still think the problem is also relevant for others. Thanks for your feedback! Jan 18 '15 at 21:04
  • 1
    If the pgf problem doesn't occur in ieeetran, then it's a bug in a less-known and less-used class. Also, you might be able to use the standalone class to make PDF graphics for inclusion into the main document. Jan 18 '15 at 21:06
  • @MikeRenfro: I had the same idea. But I want to make sure I use the same font and column width and so on. My plan was to produce the diagram and then use the external function of pgf and just use the standalone pdf afterwards for the submission. Jan 18 '15 at 21:10
  • Is column width an issue for a standalone graphic? And can't you just ensure you set up the fonts in the preamble so they match? [I actually had a graphic today which not only refused to be externalised, it refused to be \input without messing up. In the end, I just produced it separately.]
    – cfr
    Jan 18 '15 at 21:41

You used to see that error quite a bit when the color package was introduced back in 1994, but you would normally expect that any class file that has been used in the last 20 years would have been updated by now.

The ieee class re-instates the LaTeX2.09 float handler so removes support for the ! float option, for color (which causes the error message) and any fixes added since LaTex2e came out.

If you really must use this class, you can re-instate lateX2e's float handling (here I've used the version from fixltx2e),


\def\@xfloat #1[#2]{%
  \def \@captype {#1}%
   \def \@fps {#2}%
   \@onelevel@sanitize \@fps
   \def \reserved@b {!}%
   \ifx \reserved@b \@fps
     \ifx \@fps \@empty
     \@floatpenalty -\@Mii
       \@tempcnta \sixt@@n
       \expandafter \@tfor \expandafter \reserved@a
         \expandafter :\expandafter =\@fps
           \if \reserved@a h%
             \ifodd \@tempcnta
               \advance \@tempcnta \@ne
           \if \reserved@a t%
             \@setfpsbit \tw@
           \if \reserved@a b%
             \@setfpsbit 4%
           \if \reserved@a p%
             \@setfpsbit 8%
           \if \reserved@a !%
             \ifnum \@tempcnta>15
               \advance\@tempcnta -\sixt@@n\relax
       \@tempcntb \csname ftype@\@captype \endcsname
       \multiply \@tempcntb \@xxxii
       \advance \@tempcnta \@tempcntb
       \global \count\@currbox \@tempcnta
  \global \setbox\@currbox
      \vbox \bgroup



  • Thanks a lot! I forwarded the answer to the ieee class file maintainer. It's amazing how much the TeX specialist know here. Jan 19 '15 at 13:15
  • 1
    @ManuelKuehner yes well I did write the color package that broke this, so I might be expected to know about it even if it was a long while ago:-) Jan 19 '15 at 13:21

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.