Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Can someone explain when to use the xcolor package instead of the color package?

Unless you are creating your own specific colors, the differences between the packages seem to be fairly superficial. Am I missing something that makes one package better than the other?

Note: I only use the packages to add a little bit of color here and there to my documents. I'm by no means an advanced user, but I want to know which of the packages are preferred and for what reasons.

Edit: The xcolor package documentation states: Its purpose can be summarized as to maintain the characteristics of color, while providing additional features and flexibility with (hopefully) easy-to-use interfaces.

So for non-advanced users, its just a matter of syntax preference, right?

share|improve this question
5  
I always use xcolor and I love (and probably over-use) \colorlet{<new color name>}{<old color name>} (e.g. for \colorlet{important}{red} or something) –  cgnieder Jan 7 '13 at 19:10
6  
The use of colour mixtures is a big addition brought along by xcolor (e.g. using \color{blue!30!green}). –  Werner Jan 7 '13 at 19:14
2  
I think you answered your own question, if you don't need the additional features of xcolor you can simply stick with color; even though I can't see the disadvantage in using xcolor in the first place. –  xfoo Jan 7 '13 at 19:15
add comment

1 Answer

up vote 22 down vote accepted

All features of color are available by loading the xcolor package as well. I would say that you can always load the latter one since:

  1. You don't have to care which features are in which one.

  2. You surely satisfy all other packages relying on color/xcolor.

  3. Many package load it anyways (tikz to name the most important one), so you even don't have to load it yourself.

Notice that there are other pairs of packages where one extends the other:

  • color < xcolor
  • graphics < graphicx
  • amsmath < mathtools (in the sense you don't have to load amsmath)
  • and surely more...
share|improve this answer
    
I would have one caveat regarding mathtools. it throughs our warning when using unicode-math. I sure one can get rid of these but haven't worked at how yet. –  ArTourter Jan 7 '13 at 19:45
    
Not to forget: users of TikZ are loading xcolor anyway –  cgnieder Jan 7 '13 at 19:48
    
@ArTourter I know (that's why I added the notice to that one). However, I included these comments only to provide some "background" ;) –  tohecz Jan 7 '13 at 19:55
    
Thanks for the good answer. Sounds like I should always load xcolor. It sure would be nice to have a table or document for all of these kinds of "super" packages. Someone new (or a mid-level user, like myself) to LaTeX would unknowingly load a package not ever knowing the capabilities of the advanced packages. –  Jeremy Jan 7 '13 at 20:23
2  
@Jeremy If you open this page that exists for every package: ctan.org/pkg/color you see that for package color, the package xcolor is listed under "See also". –  tohecz Jan 7 '13 at 20:29
add comment

Your Answer

 
discard

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.