我正在使用蒂克兹包来绘制一些图表。此外,我需要颜色包来突出显示一些内容。由于维基百科颜色包页面指出,必须使用前tikz 包。我这样做了,现在得到了大量的
软件包 xcolor 警告:第 xxx 行颜色定义不兼容
其中 xxx 代表很多很多行,我无法控制。
有什么办法可以解决这个问题吗?
一个工作示例:
\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}
答案1
改变这一小行代码
\usepackage[usenames,dvipsnames]{color}
到
\usepackage[usenames,dvipsnames]{xcolor}
已修复,谢谢@Ignasi