![在同一个 tikpicture 环境中绘制电路和量子电路](https://linux22.com/image/456398/%E5%9C%A8%E5%90%8C%E4%B8%80%E4%B8%AA%20tikpicture%20%E7%8E%AF%E5%A2%83%E4%B8%AD%E7%BB%98%E5%88%B6%E7%94%B5%E8%B7%AF%E5%92%8C%E9%87%8F%E5%AD%90%E7%94%B5%E8%B7%AF.png)
我想添加一个电路符号(电容器)和quantikz
仪表在相同的tikzpicture
环境中,但这并没有绘制quantikz
符号。我遗漏了什么?
\documentclass{article}
\usepackage{amssymb,amsfonts,dsfont}
\usepackage{tikz}
\usepackage{quantikz}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{quantikz}
\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,0) to [capacitor] (2,0);
\node at (1,-1) {capacitor};
\draw (0,-4) to |[meter]| (2,-4);
\node at (1,-5) {meter};
\end{tikzpicture}
\end{document}
答案1
meter
您可以添加具有 定义的样式的节点quantikz
。
\documentclass{article}
\usepackage{amssymb,amsfonts,dsfont}
\usepackage{tikz}
\usetikzlibrary {circuits.ee.IEC}
\usetikzlibrary{quantikz}
\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,0) to [capacitor] (2,0);
\node at (1,1) {capacitor};
\node[meter, label=below:meter] (M) at (1,-2) {};
\draw (M) edge (0,-2) (2,-2) edge (M);
\end{tikzpicture}
\end{document}