LyXcolor | Named Colors

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
StarKid
Posts: 21
Joined: Thu May 26, 2011 8:47 pm

color | Named Colors

Post by StarKid »

How can I use named colors in LyX? I can't add \usepackage[usenames]{color} to the preamble because \usepackage{color} is there by default and I get an "option
clash for package color" error.
Last edited by StarKid on Mon Nov 14, 2011 12:07 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: 10345
Joined: Mon Mar 10, 2008 9:44 pm

color | Named Colors

Post by Stefan Kottwitz »

You could use

Code: Select all

\PassOptionsToPackage{usenames}{color}
or specify usenames as option for the document class, which would be inherited.

Stefan
LaTeX.org admin
StarKid
Posts: 21
Joined: Thu May 26, 2011 8:47 pm

color | Named Colors

Post by StarKid »

Neither of these had any effect, if I did things correctly. I added

Code: Select all

\PassOptionsToPackage{usenames}{color}
to the preamble (wasn't sure if it was supposed to be ...{usenames,dvipsnames}..., so I tried that too, separately). I have hyperref support enable and I tried setting urlcolor= royalblue then urlcolor=apricot just to test another color. I got an "undefined color" error both times. The same thing happened when I added

Code: Select all

usenames
to the Document Class->Class Options->Custom.

This is on a clean lyx test file, article class, with nothing but a hyperlink in it, hyperref enabled, and

Code: Select all

urlcolor=apricot
in Document Settings->PDF Properties->Additional Options.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: color | Named Colors

Post by Stefan Kottwitz »

You could use the xcolor package instead.

Stefan
LaTeX.org admin
StarKid
Posts: 21
Joined: Thu May 26, 2011 8:47 pm

color | Named Colors

Post by StarKid »

The solution found on the gmane lyx.general group for using the dvips colors was the following (for pdflatex):

Place

Code: Select all

usenames,dvipsnames
in the Custom Class Options box and add

Code: Select all

\usepackage{pdfcolmk} 
to the preamble.

Details here:http://www.maths.adelaide.edu.au/anthon ... secol.html
Post Reply