I have been encountering a very strange behaviour with the ieeecolor.cls document class! Compiling a latex document using this class with the tikz package triggers some color warnings: Warning Incompatible color definition, but the pdf generated seems to be as expected (i.e. see MWE below).

However, very odd things happen when the following section is added to the tex file:

%%%% Inverse PDF page and text color

In this case, the behaviour of latex is rather unexpected and the colors are not as they should anymore. This seems to come from a clash between the new ieeecolor class and some packages like tikz.

Has anyone encountered this issue before? Has anyone find a fix for this?

The ieeecolor class can be found on the IEEE Author Centre Website, it requires the files ieeecolor.cls and 'generic.sty'.

Minimum working example with page and text color code commented:

%       1       2       3       4       5       6       7       8
%\documentclass[letterpaper,10pt,conference]{ieeeconf}  % Comment this line out
                                                        % if you need a4paper
%\documentclass[a4paper, 10pt, conference]{ieeeconf}    % Use this line for a4
                                                        % paper
\documentclass[journal,twoside,web]{ieeecolor}          % %% NEW ieeecolor class %%
% \IEEEoverridecommandlockouts                          % This command is only
                                                        % needed if you want to
                                                        % use the \thanks command
% \overrideIEEEmargins
% See the \addtolength command later in the file to balance the column lengths
% on the last page of the document

% The following packages can be found on http:\\www.ctan.org

%%%%% Inverse PDF page and text color

\title{My Dummy Article}

\thanks{J.~Caesar is with the Senate House, Rome}




Key word 1, Key word 2.

\section{Dummy Section 1}


\section{Dummy Section 2}


\draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0);
\caption{A Dummy Square figure}




\def\journalname{Generic Colorized Journal}

ieeecolor.sty is a bit of a pain in the back. BTW, does anybody know who can be contacted to post patches?

There are two technical problems here, and one philosophical thing.

The philosophical thing is: is it worth caring? When they accept your paper, they will re-format it with something that's not LaTeX at all, and they want separate figures anyway, which are better build with standalone. But if you want your file working for internal use or submission to some archive, then yes, maybe it's worth it to care.

The technical problems are two:

  1. the first one is quite big: color will leak. The linked answer provides a nice answer for it.
  2. The package loads color, not xcolor (in 2021!), which is why you have all the problems with TikZ, which requires xcolor.

Possible solutions.

  1. patch ieeecolor.cls
--- ieeecolor.cls.orig  2021-06-04 11:51:15.355826034 +0200
+++ ieeecolor.cls   2021-06-04 12:11:40.354385057 +0200
@@ -667,12 +667,13 @@
 \ProvidesClass{IEEEtran}[2002/11/18 revision V1.6b by Michael Shell]
 \typeout{-- See the "IEEEtran_HOWTO" manual for usage information.}
 \typeout{-- The source comments contain changelog notes.}
+% \RequirePackage{color}
@@ -2255,16 +2256,16 @@
 \@IEEEfigurecaptionsepspace% V1.6 was a hard coded 5pt
 % 3/2001 use footnotesize, not small; use two nonbreaking spaces, not one
-\setbox\@tempboxa\hbox{\footnotesize #1.\color{black}\normalcolor~~\sf\boldmath #2}%
+\setbox\@tempboxa\hbox{{\footnotesize #1.\color{black}\normalcolor~~\sf\boldmath #2}}%
 \ifdim \wd\@tempboxa >\hsize%
 % if caption is longer than a line, let it wrap around
-\setbox\@tempboxa\hbox{\footnotesize #1.\color{black}\normalcolor~~ }%
+\setbox\@tempboxa\hbox{{\footnotesize #1.\color{black}\normalcolor~~ }}%
 \parbox[t]{\hsize}{\footnotesize \noindent\unhbox\@tempboxa\sf\boldmath #2}%
 % if caption is shorter than a line,
 % allow user to control short figure caption justification (left or center)
-\ifcenterfigcaptions \hbox to\hsize{\footnotesize\hfil\box\@tempboxa\hfil}%
-\else \hbox to\hsize{\footnotesize\box\@tempboxa\hfil}%
+\ifcenterfigcaptions \hbox to\hsize{{\footnotesize\hfil\box\@tempboxa\hfil}}%
+\else \hbox to\hsize{{\footnotesize\box\@tempboxa\hfil}}%

This should fix both problems, I think.

  1. If you do not want to touch the original class, let's try to trick ieeecolor by loading xcolor before the class; fix the other problem with Phelype Oleinik fix: just change your invocation of \documenclass with (tested using the ieeecolor.cls downloaded this morning!):
\documentclass[journal,twoside,web]{ieeecolor}          % %% NEW ieeecolor class %%
% \IEEEoverridecommandlockouts                          % This command is only
                                                        % needed if you want to
% Fix ieeecolor's \caption

Both seem to work for me, but I had no time to check deeply.

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.