# Why do I get an error “Too many }'s” when using package rotating

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:

\begin{figure}
\caption{general figure caption}   \label{gnrl}
\centering
\includegraphics[width=2.5in]{figures/generalfig.eps}
\end{figure}


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.

-
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. –  Peter Grill Nov 27 '12 at 6:00
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:

\makeatletter
\let\latex@xfloat=\@xfloat
\def\@xfloat #1[#2]{%
\latex@xfloat #1[#2]%
\def\baselinestretch{1}
\@normalsize\normalsize
\normalsize
}
\makeatother

-
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.) –  wasteofspace 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