[Tex/LaTex] When to use the xcolor package instead of the color package

best practicescolorpackages

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?

Best Answer

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...