I'm receiving an error "! Extra }, or forgotten \endgroup" with all of my figures in my thesis , when I use graphicx and rotating usepackage simulatenously. If I use graphicx package only then there is an error in \begin{sidewaystable} tables. I am using Miktex 2.8 and WinEdt 5.5. The full error output is:

"[11] [12] ! Too many }’s. \color@endbox ->\color@endgroup \egroup 1.113 \end{figure}

regarding the code fragment:

  \caption{general figure caption}   \label{gnrl}

Does anybody know what the problem is? It seems from a Google search that the problem is quite common, yet none of the solutions are working for me. Any help would be appreciated.

  • 2
    Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. In this case, we need a fully compilable MWE in order to be able to diagnose the problem. Nov 27 '12 at 6:00
  • 2
    We need to be able to reproduce the problem in order to adequately understand what's going on. And this is difficult to answer from your question in its current form. Moreover, LaTeX may throw an error for line 113, but the problem may lie elsewhere (earlier). What if you remove everything but the "offending" figure while still keeping both graphicx and rotating?
    – Werner
    Nov 27 '12 at 6:06

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.

Here this error message has been solved, caused by \@xfloat:

Several times I saw that this redefinition fixed it, which can simply made in your preamble - if you experience the same problem, cause by an \@xfloat definition for single-spaced floats in a differently (double-) spaced document:

\def\@xfloat #1[#2]{%
  \latex@xfloat #1[#2]%
  • rotating doesn't play with \@xfloat so my interpretation of your comment doesn't work. we need an mwe from the requester (imo ... my crystal ball is all foggy these days.) Nov 27 '12 at 11:07
  • @wasteofspace Sure, I guess it's not a problem of rotating but of the document class or a not yet mentioned style file. I hope the answer helps in locating the problem. If the OP doesn't come back and tells us class and thesis style, we surely would close as too localized.
    – Stefan Kottwitz
    Nov 27 '12 at 11:13

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.