CircuiTikZ 和 FET 绘图

CircuiTikZ and FET drawing

是否有一些简单的方法可以避免 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自动加载的,那个有一个强制参数(电压方向标准,看手册和wanings!;-)。

所以第一个变化可能是这样的:

\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}

这导致:

那我觉得还是用相对定位的方式让电路可重定位比较好

如果你 need/want FET 以分支为中心,最好从它开始或使用 calc TikZ 库(已经由 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}