I have these following packages defined in my preamble and once the file is ran, it creates an error of the following saying there is a clash within the package options. Packages are below:



Error Log

Is there a way to prevent and what is the actual root of the problem to persist?

  • 2
    tikz is the package which already loads xcolor – user2478 Aug 14 '11 at 6:54
  • \PassOptionsToPackage{dvipsnames}{xcolor} as I alread wrote in my answer – user2478 Aug 14 '11 at 7:14
  • Okay, right. When putting commands like that before \documentclass{...}, is that like in a sense making a global variable? – night owl Aug 14 '11 at 7:35
  • no, as said it only prevents an option clash – user2478 Aug 14 '11 at 8:08
  • 1
    yes, they are global because it is the highest level – user2478 Aug 14 '11 at 8:22

However, it looks like that xcolor is already loaded by your documentclass or another package

  • @Herbet: Hmm, interesting if it could be the documentclass. The document looks like this: \documentclass[addpoints]{exam}. – night owl Aug 14 '11 at 6:38
  • 4
    @night owl: that class doesn't load a color package, so it is antother package which does it. However, you could use the above code to prevent option mismatch, it is always save. – user2478 Aug 14 '11 at 6:42
  • @Herbet: Okay that is a good idea. You meant to say it is always "safe" right, besides using the word "save"? :) – night owl Aug 14 '11 at 6:52
  • @night owl: uuh, always the same problem: my fingers and my brain are not synchronized ;-) – user2478 Aug 14 '11 at 6:53
  • @Herbet: Hahahaha, no worries, I think 'almost' all of us computer gals/guys have this problem when we think on our toes but body mechanics is just too slow to tag along. – night owl Aug 14 '11 at 6:57

Well, since Herbert provide a general solution for option clash, here is another solution:


Just put xcolor package before tikz package.


In LaTeX, you cannot load a package through \usepackage twice or more. If a package has been loaded, another \usepackage without any options will be safely ignored, but a \usepackage with some options will produce an option clash.

tikz package loads xcolor internally without any options. If you want to use xcolor with additional options, you can use it before tikz.

You can even use this way to prevent the option clash:


Options for \documentclass are global. These options will be passed to any later packages if possible. It is especially useful if you want to pass an option to a package that loaded by the document class. However, it isn't as precise as \PassOptionsToPackage.

  • @ Leo: +1...Thanks alot. This was some very enlightening info to know and explanation was on point. Its good to learn something without any confusion. – night owl Aug 14 '11 at 10:48
  • that makes sense if you are really sure, that all packages should get this option. This is not in all cases a good choice – user2478 Aug 14 '11 at 13:35



does not produce any warnings or errors on a current TeXlive 2011 installation.

If you are using additional packages (hyperref is one that this problem is seen with, for example) here may well be ways round the problem: for example, try using the xcolor svgnames option if that color range is appropriate, use explicit \definecolor commands or try various diagnostic procedures.

Providing more information, including a complete but minimal size working example of the problem would help provide better responses.

  • @ mas: Hmm, wonder if that could be it. I currently am running of of MikTeX... – night owl Aug 14 '11 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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