The code below is an MWE illustrating a clash between the auto-pst-pdf and trimspaces packages. Code is a bit complicated because of the various things I want to do, but I've stripped all of those out. I'm running the code with pdflatex --shell-escape. The error that is thrown is:

! LaTeX Error: Option clash for package xcolor.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.6 \usepackage

If I exclude the dvipsnames option to xcolor it runs without error.

Any advise as to how to fix the clash would be appreciated.

  • Load auto-pst-pdf after xcolor with option, or load[dvipsnames] as a document class option. – Bernard May 28 '18 at 23:56
  • Note that adding dvispsnames is exactly what LaTeX suggests if you do as it states in the error message you quoted and type h to get more help. – David Carlisle May 29 '18 at 7:09
  • Thanks Bernard and David. My actual application was much more complex than the MWE, but I managed to re-order things so that xcolor is now loaded before auto-pst-pdf, and all is well for now. It is, however, disturbing/frustrating that compilation success is so sensitive to package ordering – Leo Simon May 29 '18 at 16:01

Your Answer

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

Browse other questions tagged or ask your own question.