TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using beamer for writing my presentation. I was initially using latex+dvipdf, then with the help of other tex.exchange users I recognized that I cannot use transparency in this way. So now I am switching to pdflatex.

Because I use personalized colors and didn't want to use RGB names, I was using names from dvipsnames, but now I have to switch to svgnames, and the color names are of course different. I would like to use a variable that stores the color name, so that I can choose a color to be defined either in svgnames or in dvipsnames, depending if I am using pdflatex or not.

I tried this

\ifpdf color1=cyan
\else color1=PineGreen \fi

but it doesn't work, what should I do?

share|improve this question
Since beamer uses xcolor, I suppose that \colorlet{color1}{cyan} should work. – egreg Oct 8 '12 at 14:03
It isn't clear to me why you can't use dvipsnames with pdflatex. Do you have a MWE (ie small complete document that shows the problem) – David Carlisle Oct 8 '12 at 14:15
@David Carlisle you are right, it works. I must have been mistaken earlier. I suppose I should delete this question? On the other side the question still makes sense, regardless if dvipsnames work or not with pdflatex – simona Oct 8 '12 at 14:47
up vote 4 down vote accepted

You can load the dvipsnames option:


Since beamer already loads xcolor with the svgnames option, you can't say \usepackage[dvipsnames]{xcolor} (or color); in order to overcome this limitation, one can specify that option to the class.

If you still want to use different colors based on the compiler, then


will work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.