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.
LyX ⇒ color | Named Colors
color | Named Colors
Last edited by StarKid on Mon Nov 14, 2011 12:07 pm, edited 1 time in total.
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
You could use
or specify usenames as option for the document class, which would be inherited.
Stefan
Code: Select all
\PassOptionsToPackage{usenames}{color}
Stefan
LaTeX.org admin
color | Named Colors
Neither of these had any effect, if I did things correctly. I added 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 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 in Document Settings->PDF Properties->Additional Options.
Code: Select all
\PassOptionsToPackage{usenames}{color}
Code: Select all
usenames
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
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
color | Named Colors
The solution found on the gmane lyx.general group for using the dvips colors was the following (for pdflatex):
Place
in the Custom Class Options box and add
to the preamble.
Details here:http://www.maths.adelaide.edu.au/anthon ... secol.html
Place
Code: Select all
usenames,dvipsnames
Code: Select all
\usepackage{pdfcolmk}
Details here:http://www.maths.adelaide.edu.au/anthon ... secol.html