答案1
将以下几行添加到您的序言中。它们定义了xmeter
,看起来像等等ammeter
,ohmmeter
但没有字母。
\ctikzset{bipoles/xmeter/height/.initial=.60}
\ctikzset{bipoles/xmeter/width/.initial=.60}
\pgfcircdeclarebipole
{}%
{\ctikzvalof{bipoles/xmeter/height}}%
{xmeter}%
{\ctikzvalof{bipoles/xmeter/height}}%
{\ctikzvalof{bipoles/xmeter/width}}%
{\drawmeteringcircle}
\makeatletter
\compattikzset
{xmeter/.style =
{\circuitikzbasekey, /tikz/to path={\pgf@circ@bipole@path{xmeter}{#1}}}
}
\makeatother
下面的图片是通过下面的代码得到的。
\documentclass[border=1mm]{standalone}
\usepackage{circuitikz}
% General measuring device
\ctikzset{bipoles/xmeter/height/.initial=.60}
\ctikzset{bipoles/xmeter/width/.initial=.60}
\pgfcircdeclarebipole
{}%
{\ctikzvalof{bipoles/xmeter/height}}%
{xmeter}%
{\ctikzvalof{bipoles/xmeter/height}}%
{\ctikzvalof{bipoles/xmeter/width}}%
{\drawmeteringcircle}
\makeatletter
\compattikzset
{xmeter/.style =
{\circuitikzbasekey, /tikz/to path={\pgf@circ@bipole@path{xmeter}{#1}}}
}
\makeatother
\begin{document}
\begin{circuitikz}
\draw (0,0) [short, o-] to [xmeter] (2,0) to [short, -o] (2,0);
\end{circuitikz}
\end{document}