当我尝试使用 pdflatex 编译 TeX 文档时出现此错误:
程序包 xcolor 错误:未定义颜色“lightblue2”
这是我的文件:
\documentclass{article}
\usepackage[x11names, rgb]{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{snakes,arrows,shapes}
\usepackage{amsmath}
%
%
%
%
\begin{document}
\pagestyle{empty}
%
%
%
\enlargethispage{100cm}
% Start of code
\begin{tikzpicture}[>=latex',line join=bevel,]
%%
\node (Wollongong) at (487bp,594bp) [draw=lightblue2,fill=lightblue2,ellipse] {Wollongong};
\node (PDP-11 Sys V) at (884bp,306bp) [draw=lightblue2,fill=lightblue2,ellipse] {PDP-11 Sys V};
\node (Interdata) at (258bp,594bp) [draw=lightblue2,fill=lightblue2,ellipse] {Interdata};
\node (2*8 BSD) at (221bp,162bp) [draw=lightblue2,fill=lightblue2,ellipse] {2.8 BSD};
% CODE REMOVED TO SAVE SPACE
%
\end{tikzpicture}
% End of code
%
\end{document}
%
答案1
您正在寻找颜色LightBlue2
,而不是lightblue2
。
在内部,所有颜色都表示为宏,并且宏区分大小写。也就是说,\latex
不同于\Latex
和\LaTeX
和\LATEX
和...实际上,颜色X
存储在宏中\\color@X
:
\documentclass{article}
\usepackage[x11names]{xcolor}
\begin{document}
\textcolor{LightBlue2}{something}
\makeatletter
\ttfamily\verb|\\color@LightBlue2|:
\expandafter\expandafter\expandafter\strip@prefix\expandafter\meaning\csname \string\color@LightBlue2\endcsname
\end{document}
答案2
请参阅文档第 39 页xcolor
以了解正确的颜色名称 (x11names)。运行以下命令即可获取文档texdoc xcolor