Generalcolor problems

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mro
Posts: 18
Joined: Thu Oct 16, 2008 10:49 pm

color problems

Post by mro »

Hi there...

First, I tried to create a new command like this

Code: Select all

\newcommand{\chc}{\cellcolor{\lightgray}}
because I am lazy to always have to write

Code: Select all

.... & \cellcolor{lightgray} blabla & ...

inside a tabular cell that has to be colored, so I should now be able to write

Code: Select all

.... & \chc blabla & ...


That barked out on me with

Code: Select all

! Missing \endcsname inserted.
<to be read again>
                   \protect
l.790     $x_3^-$ & \chc $c_3$  &
                                  $0$         \\\hline
?
! Emergency stop.
<to be read again>
                   \protect
l.790     $x_3^-$ & \chc $c_3$  &
                                  $0$         \\\hline
So I tried

Code: Select all

.... & \cellcolor{lightgray} blabla & ...
again.

That now tells me

Code: Select all

! LaTeX Error: Undefined color `lightgray'.
:?

(it worked before [TM])

Furthermore when I try to define new colors using \newcmykcolor it gives me a

Code: Select all

! Undefined control sequence.
l.12 \newcmykcolor
:cry:

So, somehow, all of this is related, but I currently do not know how to fix it.
An idea, anyone?

Thanks,
Marki
Last edited by mro on Thu Oct 16, 2008 11:57 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.

Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

color problems

Post by Stefan Kottwitz »

Hi Marki,

welcome to the board!
Did you define a macro \lightgray? Or did you define a color lightgray, without leading backslash?
You wrote \chc instead of \chcc.

\newcmykcolor is defined by pstricks (pstricks.sty) and texpower (tppstcol.sty), load the corresponding packag by \usepackage.

For more specific help regarding the errors please provide a minimal example showing the problems.

Stefan
LaTeX.org admin
mro
Posts: 18
Joined: Thu Oct 16, 2008 10:49 pm

color problems

Post by mro »

Stefan_K wrote: Did you define a macro \lightgray? Or did you define a color lightgray, without leading backslash?
Thanks ;)
I had not included pstricks anymore since I switched to ps4pdf some time ago... :oops:
Additionally,
\cellcolor{\lightgray}
should obviously (now) correctly be
\cellcolor{lightgray}

Thanks again
Marki
Post Reply