LaTeX forum ⇒ Graphics, Figures & Tables ⇒ color package incompatible with figures?

Information and discussion about graphics, figures & tables in LaTeX documents.
terry7788
Posts: 3
Joined: Mon May 11, 2009 11:13 am

color package incompatible with figures?

I am writing a thesis. The compilation worked well but, recently after I added a line of \usepage{color} because I need to use color for some text, there is always a error of "Too many }'s" appearing at every place importing a graphic, as below:

======== quoted from TEX file ======<BEGIN>
\begin{figure}[tb]\centering\includegraphics[width=0.8\linewidth]{fig/concepts}\caption{...}\label{fig:concepts}\end{figure}

======== quoted from TEX file ======<END>
======== quoted from log file ======<BEGIN>
 <use fig/concepts.pdf>! Too many }'s.\color@endbox ->\color@endgroup \egroup  l.57 \end{figure} You've closed more groups than you opened.Such booboos are generally harmless, so keep going.  ! LaTeX Error: \begin{document} ended by \end{figure}.

======== quoted from log file ======<END>

I asked my friends and searched on Internet for several days but still cannot solve the problem. I would really appreciate if anybody can help me out. Thank you very much!

I've attached the TEX file and the LOG file for your reference.
Attachments
thesis.log
thesis.tex
Last edited by cgnieder on Sun Sep 15, 2013 7:58 pm, edited 1 time in total.
Reason: added code markup

Tags:

Stefan Kottwitz
Posts: 8077
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi Terry,

welcome to the board!
It would work if you remove the definition of \@xfloat. Check if you really need that.

Stefan

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
Try the xcolor package instead and see if its working.

Best regards and welcome to the board
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

terry7788
Posts: 3
Joined: Mon May 11, 2009 11:13 am
Hi Stefan, you suggestion works well. Thank you!

Stefan_K wrote:Hi Terry,

welcome to the board!
It would work if you remove the definition of \@xfloat. Check if you really need that.

Stefan

terry7788
Posts: 3
Joined: Mon May 11, 2009 11:13 am
Hi Thorsten,

I've solved the problem with Stefan's suggestion. Thank you anyway for your kind help!

Terry

localghost wrote:Try the xcolor package instead and see if its working.

Best regards and welcome to the board
Thorsten

Hossein
Posts: 2
Joined: Mon Jun 22, 2009 12:07 am
Dear Stefan,

Stefan_K wrote:Hi Terry,

It would work if you remove the definition of \@xfloat. Check if you really need that.

Stefan

I am experiencing the same problem. However, I don't know how to apply the above change as there is no \x@float in my stuff, or at least I can't locate it. I don't see it in the color package anywhere either. I'll attach my log file with the hope that you can locate my problem as well.

TIA,
--Hossein

Hossein
Posts: 2
Joined: Mon Jun 22, 2009 12:07 am
Stefan_K wrote:
It would work if you remove the definition of \@xfloat. Check if you really need that.

Hossein wrote:
However, I don't know how to apply the above change as there is no \x@float in my stuff, or at least I can't locate it.

Located it (in the thesis style I'm using). Thanks anyhow.

danbaatar
Posts: 8
Joined: Mon Apr 26, 2010 11:14 pm
I am having the same problem. I am also working on a thesis, but the float redefinition is nowhere to be found in the style file. Is there something else that could cause this problem?

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm
Contact:
Please provide some information on what you are actually doing!
Joseph Wright

danbaatar
Posts: 8
Joined: Mon Apr 26, 2010 11:14 pm
Here is a pretty minimal example that produces problem (for use together with the attached style file):
\documentclass[10pt]{article}%\documentclass{byuPhDprop} \usepackage{pgf}\usepackage{tikz}\usetikzlibrary{arrows,shapes,automata,backgrounds} \begin{document}\begin{figure}[htb]   \centering     \begin{tikzpicture}[node distance=7mm, line/.style={>=latex}]       \tikzstyle{vertex} = [circle,draw=black, fill=white, minimum size=10mm]       \node[vertex] (x) at (0,0) {$x$};     \end{tikzpicture}\end{figure}\end{document}

If you leave the first line un-commented, and run pdflatex, this produces a pdf with just a drawing of a circle in it labeled with an x.

If you comment out the first line and un-comment the second, so that it's using the style file, then I get this error:
! Too many }'s.\color@endbox ->\color@endgroup \egroup
Attachments
byuPhDprop.cls
The dissertation style file.