Graphics, Figures & TablesConflict between graphicx and colortbl?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thomash
Posts: 2
Joined: Tue Apr 12, 2011 11:18 pm

Conflict between graphicx and colortbl?

Post by thomash »

Hi,

I would like to include a table with highlighted rows into my thesis, so I am trying to load the colortbl package. Unfortunately, when I add \usepackage{colortbl} to my preamble, I get the following error:

Code: Select all

<figs/ch_background/radon.eps>
! Too many }'s.
\color@endbox ->\color@endgroup \egroup

l.29 \end{figure}
From doing some digging around on Google, I gather that this is probably due to some kind of conflict between the color package (used by colortbl) and graphicx, which I am using to include all my figures. The error occurs at the first invocation of \includegraphics in my document, which seems to support this theory. Unfortunately, I can't figure out how to resolve this issue! Right now in my preamble I have:

Code: Select all

\usepackage{colortbl}
\usepackage{graphicx}
(in addition to a bunch of other package inclusions, definitions, etc.) I have tried switching the order of the statements, passing in a few options, etc. but nothing has worked. :( Any suggestions would be appreciated!

Recommended reading 2024:

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

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

mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Re: Conflict between graphicx and colortbl?

Post by mas »

I have been using those two packages without any problem. You should post a minimal example which gives you the error.

Regards.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
thomash
Posts: 2
Joined: Tue Apr 12, 2011 11:18 pm

Conflict between graphicx and colortbl?

Post by thomash »

Thanks for the reply! In coming up with a minimal example, I've determined that it's a problem with a custom .sty file I'm using for all my thesis formatting... the following example compiles:

Code: Select all

\documentclass[11pt,letterpaper]{report}

%\usepackage{sfuthesis}
\usepackage{colortbl}
\usepackage{graphicx}

\begin{document}

\begin{figure}[ht]
\begin{center}
\includegraphics[width=0.5\linewidth]{figs/ch_background/radon.eps}
\end{center}
\caption[Radon transform]{Parameterization of the Radon transform in 2D. }\label{F:radon}
\end{figure}

\end{document}
but uncommenting \usepackage{sfuthesis} leads to the error specified in the first post. I suppose this means that sfuthesis.sty is redefining some command and creating a conflict with colortbl...

Unfortunately I am kind of a neophyte when it comes to writing .sty files, so I'm not really sure where to start with this error. The file was given to me by another student who used it for his thesis; the university has lots of formatting requirements and apparently this .sty file addresses all of them. I've attached it to this post if anyone wants to have a look -- although I realize it may be asking a bit much for someone to debug a custom .sty file. :) Nonetheless, if it is a simple thing that can be fixed, please let me know!

Cheers,
Thomas
Attachments
sfuthesis.sty
(7.56 KiB) Downloaded 294 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Re: Conflict between graphicx and colortbl?

Post by Stefan Kottwitz »

Hi Thomas,

that style file is of 1996. Before we try to fix problems with this very old style file, you might consider to use a newer one.

Stefan
LaTeX.org admin
Post Reply