问题描述
是否有一些简单的方法可以避免FET的引脚短路?
\documentclass{standalone}
\usepackage{tikz}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0)
to[I,I=$I_s$] (0,2) % The current source
to[short] (2,2);
\draw (2,0)
to node[nigfete]{FET} (2,2) % The FET transistor
to[short] (2,0) to[short] (0,0);
\draw (2,2)
to[short] (4,2)
to[R=$R$] (4,0)
to[short] (2,0);
\draw (4,2);
\draw node[rground]{};
\end{circuitikz}
\end{document}
解决方法
我不确定您想实现什么,但是
- 仅在需要添加极点或标签时才使用
short
,否则--
更容易键入; - 使用组件的锚点。
-
tikz
由circuitikz
自动加载,并且其中有一个强制性参数(电压方向标准,请参阅手册,然后逐渐减弱!;-)。
第一个变化可能是这样:
\documentclass[border=4pt] {standalone}
\usepackage[RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) node[rground]{}
to[I,I=$I_s$] (0,2) -- (2,2)
node[nigfete,anchor=D](F){FET} % The FET transistor
(F.S) to[short,-*] (2,0) -- (0,0);
\draw (2,2) -- (4,2)
to[R=$R$] (4,0) -- (2,0);
\draw node[rground]{};
\end{circuitikz}
\end{document}
导致:
然后,我认为,最好使用相对定位来使电路可重定位。
如果您需要/想要以FET为中心的分支,最好从它开始,或者使用calc
Ti k Z库(已由circuitikz
加载) )。在以下电路中,所有移动都是相对的,因此您只需更改第一个(0,0)
就可以移动它:
\documentclass[border=4pt] {standalone}
\usepackage[RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) node[rground](GND){} to[I,I=$I_s$] ++(0,2)
-- ++(2,0) coordinate(top)
-- ++(2,0) to[R=$R$] ++(0,-2)
-- (GND-|top) coordinate(bottom)
-- (GND)
($(top)!0.5!(bottom)$) node[nigfete](F){FET}
(F.D) -- (top) (F.S) -- (bottom);
\end{circuitikz}
\end{document}