CircuiTikZ and FET drawing

Viewed 942

Is there some simple way to avoid shorting the pins of a 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}
1 Answers

I am not sure to understand what you want to achieve, but

  • use short only if you need to add poles or labels, otherwise -- is easier to type;
  • use the anchors of the components.
  • tikz is automatically loaded by circuitikz, and that one has a mandatory argument (the voltage direction standard, look at the manual and at the wanings! ;-).

So a first change could be this:

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

which leads to:

enter image description here

then, in my opinion, it would be better to use relative positioning to make the circuit relocatable.

If you need/want the FET centered in the branch it could be better to start with it or use the calc TikZ library (already loaded by circuitikz). In the following circuit all the movement are relative, so you can move it by just changing the first (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}

enter image description here

Related