Graphics, Figures & TablesColors in tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Colors in tables

Post by Bozack »

Hi,

I'we just tried using some color in a table heading, to get it to look better - and I wanted to use a color I defined myself. To do the table-coloring I use the package colortbl.

My problem is that it does not recognize colors that I myself have defined. It gives me the error

Code: Select all

Package xcolor Error: Undefined color model 'NavyBlue'.
When I try to use the color in pstricks, though, it does understand the color...?

Does anyone see how this can be fixed? An example file is attached below:
Attachments
test.tex
(1.1 KiB) Downloaded 365 times
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit

Recommended reading 2024:

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

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

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Colors in tables

Post by phi »

The first optional argument to \rowcolor is a color model, and NavyBlue is not a color model—that is exactly what the error message says. Probably you meant \rowcolor{NavyBlue}.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Colors in tables

Post by localghost »

You should reorganize your preamble a little bit.

Code: Select all

\documentclass[10pt,a4paper,twoside,final,onecolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[danish]{babel}
\usepackage{graphicx}
\usepackage[table,dvipsnames]{xcolor}
\usepackage{pst-grad,pst-coil,pst-node,pst-plot,pst-circ,pstricks-add}
\usepackage{amsfonts,amsmath,amssymb}

%\definecolor{NavyBlue}{cmyk}{0.94,0.54,0,0}
With the dvipsnames option to xcolor, the color NavyBlue is predefined (see the manual). The table option loads the colortbl package as described in the manual.


Best regards
Thorsten¹
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Colors in tables

Post by Bozack »

phi wrote:The first optional argument to \rowcolor is a color model, and NavyBlue is not a color model—that is exactly what the error message says. Probably you meant \rowcolor{NavyBlue}.
That worked :)
localghost wrote:With the dvipsnames option to xcolor, the color NavyBlue is predefined (see the manual). The table option loads the colortbl package as described in the manual.
Thanks for the tip - I'll look into that when I'we got a little more time - for now I'll use the little fix from phi :)
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Colors in tables

Post by localghost »

Bozack wrote:Thanks for the tip - I'll look into that when I'we got a little more time - for now I'll use the little fix from phi [...]
You will have to use the suggestion of phi anyway.
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Colors in tables

Post by Bozack »

localghost wrote:You will have to use the suggestion of phi anyway.
Heh, yeah, I just figured that out :P

Thanks for the help :)
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Post Reply