我从 tikz 手册中复制了一个例子,但是它编译失败
\documentclass[]{scrbook}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{circuits}
\usetikzlibrary{circuits.logic.IEC}
\listfiles
\begin{document}
\begin{tikzpicture}[rotate=-90,
circuit ee IEC,
x=3.25cm,y=2.25cm,semithick,
every info/.style={font=\footnotesize},
small circuit symbols,
set resistor graphic=var resistor IEC graphic,
set diode graphic=var diode IEC graphic,
set make contact graphic= var make contact IEC graphic]
% Let us start with some contacts:
\foreach \contact/\y in {1/1,2/2,3/3.5,4/4.5,5/5.5}
{
\node [contact] (left contact \contact) at (0,\y) {};
\node [contact] (right contact \contact) at (1,\y) {};
}
\end{tikzpicture}
\end{document}
一些错误消息的示例:
软件包 pgfkeys 错误:我不知道密钥‘/tikz/circuit ee IEC’
软件包 pgfkeys 错误:我不知道密钥‘/tikz/set resistance graphic’
答案1
这是文档中的一个小错误。文档中说
\usetikzlibrary{circuit.ee.IEC}
但你需要
\usetikzlibrary{circuits.ee.IEC}
(缺了 s)
比示例有效