18

I am using the tikz package to draw some diagrams. In addition, I need the color package for some highlighting. As the wikibooks page of the color package states, it has to be used before the tikz package. I did this and am now ending up with a huge amount of

Package xcolor Warning: Incompatible color definition on line xxx

Where xxx stand for many many lines, I don't control.

Any ideas of fixing this?

A working example:

\documentclass[12pt,a4paper,twoside]{article}
\usepackage[latin9]{inputenc}
\usepackage[usenames,dvipsnames]{color}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgf}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{graphicx}
\usepackage{listings}

\lstdefinelanguage{constraints} {
    keywords = {undefined, terminate, peephole\-constraint, temporal\-constraint, condition, rationale, result, filter, sequence, link, isParent, contains, distance, state, startsWith},
  keywordstyle=\color{blue}\bfseries,
    sensitive=false,
    alsodigit={-},
    ndkeywords={FAIL, FAIL_FINAL, PASS, PASS_FINAL, source, origin, sourceType, originType, operation, parameters},
    ndkeywordstyle=\color{OliveGreen},
    stringstyle=\color{red}\ttfamily,
    morestring=[b]',
    morestring=[b]"
}

\begin{document}
Text above.\\

\begin{lstlisting}[language=constraints]
temporal-constraint observe-value {
  rationale {
  }
  sequence {
    a << b << terminate
  }
  filter a {
    operation == 'observe'
  }
  filter b {
    operation == 'value'
    &&  parameters.value != undefined
  }
  link {
      a.parameters.name == b.parameters.name
    &&  isParent(a.origin, b.origin)
  }
}
\end{lstlisting}

\end{document}
  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jub0bs Dec 17 '13 at 13:26
  • There you go, hope this helps! – Coxa Dec 17 '13 at 14:02
  • 1
    I don't see any difference between using color or xcolor except no warnings with xcolor. – Ignasi Dec 17 '13 at 14:11
  • That's it. Thank you very much. xcolor fixed it... – Coxa Dec 17 '13 at 14:21
36

Changing this tiny line of code

\usepackage[usenames,dvipsnames]{color}

to

\usepackage[usenames,dvipsnames]{xcolor}

fixed it, thanks @Ignasi

  • 4
    I'd be interested to know why this helped, what exactly the warning means and why it is something that should be fixed :) – lucidbrot Jul 17 '18 at 19:13

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.