我需要更改体二极管的圆形节点大小以使其适应其余节点,但我还没有找到circuitikz
包中有关执行此操作的任何文档。
从此示例代码中:
\documentclass[]{standalone}
\usepackage[americanvoltages]{circuitikz}
\begin{document}%
\begin{tikzpicture}
\tikzset{%
actsw/.style={%
nigfete,%
bodydiode,%
solderdot,%
},%
}%
\draw[] (0,0)node[ocirc](){} node[actsw,anchor=D] (n_sw){};
\ctikzset{nodes width=0.03,}
\draw[] (1.5,0)node[ocirc](){} node[actsw,anchor=D,scale=0.8] (n_sw){};
\ctikzset{nodes width=0.06,}
\draw[] (3,0)node[ocirc](){} node[actsw,anchor=D,scale=0.8] (n_sw){};
\end{tikzpicture}
\end{document}%
我明白了:
答案1
没有选项可以缩放体二极管连接点或焊接点;我已经准备了一个功能要求(如果您愿意,请发表评论)。
目前,您只需使用锚点将节点叠加到连接上即可。
\documentclass[]{standalone}
\usepackage[americanvoltages]{circuitikz}
\newcommand\addbodycirc[1]{
\node [circ] at (#1.body C in){};
\node [circ] at (#1.body E in){};
\node [circ] at (#1.inner down){};
}
\begin{document}%
\begin{tikzpicture}
\tikzset{% no need to escape end-of-lines --- they're ignored here
actsw/.style={
nigfete,
bodydiode,
solderdot,
},
}
\draw[] (0,0)node[ocirc](){} node[actsw,anchor=D] (n_sw){};
\addbodycirc{n_sw}
\ctikzset{nodes width=0.03,}
\draw[] (1.5,0)node[ocirc](){} node[actsw,anchor=D,scale=0.8] (n_sw){};
\addbodycirc{n_sw}
\ctikzset{nodes width=0.06,}
\draw[] (3,0)node[ocirc](){} node[actsw,anchor=D,scale=0.8] (n_sw){};
\addbodycirc{n_sw}
\end{tikzpicture}
\end{document}
ocirc
请注意,由于ocirc
节点被绘制,因此出现问题是意料之中的前节点nigfete
。可以通过多种方式修复,但最干净的方式是明确绘制ocirc
后节点。
请注意,焊点差异是因为您正在使用scale=0.8
,这将扩大全部节点(这是一个 Ti钾Z 覆盖选项)。如果希望焊点具有与普通circ
节点相同的大小,则只需使用类transistor/scale
参数缩放晶体管即可。
\documentclass[]{standalone}
\usepackage[americanvoltages]{circuitikz}
\begin{document}%
\begin{tikzpicture}
\tikzset{% no need to escape end-of-lines --- they're ignored here
actsw/.style={
nigfete,
bodydiode,
solderdot,
anchor=D,
},
}
\draw[] (0,4) node[circ]{} node[actsw] (A){}
++(2,0) node[circ]{} node[actsw,scale=0.7](As){}
++(2,0) node[circ]{} node[actsw,circuitikz/transistors/scale=0.7](As){}
;
\ctikzset{nodes width=0.03,}
\draw[] (0,2) node[circ]{} node[actsw] (B){}
++(2,0) node[circ]{} node[actsw,scale=0.7](Bs){}
++(2,0) node[circ]{} node[actsw,circuitikz/transistors/scale=0.7](Bs){}
;
\ctikzset{nodes width=0.06,}
\draw[] (0,0) node[circ]{} node[actsw] (C){}
++(2,0) node[circ]{} node[actsw,scale=0.7](Cs){}
++(2,0) node[circ]{} node[actsw,circuitikz/transistors/scale=0.7](Cs){}
;
\end{tikzpicture}
\end{document}
但坦率地说,看到结果后,我想我会在晶体管类中添加选项,以选择焊料和体二极管点的比例;我的意见是它们应该比正常的要小circ
(因为它们标记了一个内部的连接(而不是用户制作的连接),但我将提供调整它们的选项。
答案2
只是为了好玩:
\documentclass{standalone}
\usepackage[americanvoltages]{circuitikz}
\makeatletter
\def\rlen{\pgf@circ@Rlen}
\makeatother
\begin{document}%
\begin{tikzpicture}
\node[ocirc] at (0,0) {};
\node[circle,draw,inner sep=1.13pt] at (0.2,0) {};
\draw (0.4,0) circle[radius={\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\rlen}];
\draw (0.6,0) circle[radius={0.04*\rlen}];
\end{tikzpicture}
\end{document}