Graphics, Figures & Tablescolor 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?

Post by terry7788 »

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>

Code: Select all

\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>

Code: Select all

 <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
(24.81 KiB) Downloaded 1195 times
thesis.tex
(5.93 KiB) Downloaded 1637 times
Last edited by cgnieder on Sun Sep 15, 2013 7:58 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: color package incompatible with figures?

Post by Stefan Kottwitz »

Hi Terry,

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

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

color package incompatible with figures?

Post by localghost »

Try the xcolor package instead and see if its working.


Best regards and welcome to the board
Thorsten
terry7788
Posts: 3
Joined: Mon May 11, 2009 11:13 am

color package incompatible with figures?

Post by terry7788 »

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

color package incompatible with figures?

Post by terry7788 »

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

color package incompatible with figures?

Post by Hossein »

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

color package incompatible with figures?

Post by Hossein »

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

Re: color package incompatible with figures?

Post by danbaatar »

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

Re: color package incompatible with figures?

Post by josephwright »

Please provide some information on what you are actually doing!
Joseph Wright
danbaatar
Posts: 8
Joined: Mon Apr 26, 2010 11:14 pm

color package incompatible with figures?

Post by danbaatar »

Here is a pretty minimal example that produces problem (for use together with the attached style file):

Code: Select all

\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:

Code: Select all

! Too many }'s.
\color@endbox ->\color@endgroup \egroup
Attachments
byuPhDprop.cls
The dissertation style file.
(7.34 KiB) Downloaded 978 times
Post Reply