Have a look at the following example, please.





I expect this to compile, but it reports an option clash. I thought there could be only an option clash if I try to load a package with different options and that there's no clash if the package is loaded multiple times and one time with options. Is that wrong?

I know that I could fix this by changing the order of my and xcolor but I can think about cases where I can’t influence the order (e.g. my is loaded internally by the document class).

I found \RequirePackage without option clashes because of the package loading order? where Herbert gave the solution to split the package loading, which won’t work in my case. And I asked catoptions causes option clash with xcolor, which is possibly a duplicate, a few minutes ago …


The LaTeX2e kernel defines usepackage to be exactly the same as RequirePackage in the ltclass.dtx.


So the fact that you use RequirePackage makes no difference and you still get an error. If the same package is requested more than once, nothing happens, unless the package has been requested with options that were not given the first time it was loaded, in which case an error is produced.

  • Thanks. I kown that \usepackage uses \RequirePackage but I thought that no options won’t cause problems. So did I get you right that there’s no better work around than changing the order of loading packages? – Tobi Feb 26 '12 at 10:38
  • @Tobi Unfortunately yes, unless you write your own routine to check if the package is present and then ignore errors. In general though is best to see the clashes. – Yiannis Lazarides Feb 26 '12 at 10:44
  • Thanks again. Here Ahmed quotes the error help for the clash which suggests to use global options instead. – Tobi Feb 26 '12 at 11:07

In the above linked question Ahmed Musa quotes the LaTeX error help on an option clash:

? h
The package 'xcolor' has already been loaded with options:
There has now been an attempt to load it with no options. 
Adding the global options:
to your \documentclass declaration may fix this.

It solves my problem if I set the options for xcolor via \documentclass

  Hello World!
  • 3
    Another trick is to use \PassOptionsToPackage to pass the option to the package. – Seamus Feb 26 '12 at 11:31
  • @Seamus: Yes, I know, thanks. But I don’t like it because it seems inconvenient for me. Are the any pros or cons in preferring the global option way? – Tobi Feb 26 '12 at 12:17
  • 2
    Well, if you wanted to pass draft option to one package and final option to another, your way wouldn't work… – Seamus Feb 26 '12 at 18:31
  • @Seamus. Ahh … I didn’t think on that case :-) – Tobi Feb 27 '12 at 1:48

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.