3

The following is my code.

\documentclass[12pt,letterpaper]{article}    
\usepackage[left=20mm,top=30mm,bottom=30mm,right=20mm]{geometry}

\usepackage{tikz}  % for drawing pictures
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{arrows.meta} 


\usepackage[siunitx]{circuitikz} % circuit package and  include electrical units in our labels

\begin{document}

\begin{center}
\begin{circuitikz}[american,]
\ctikzset{tripoles/mos style/arrows}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
\path (0,0) -- (2,0); % bounding box

\draw (-3,5)  -- (3,5) node[label=right: $V_{dd} \SI{}{}$] {}
 (-2,1) node[nmos](M1){$M_1$}
 (-2,5) -- (M1.drain)
(-3,1)[short, o-] to (M1.gate) node[anchor=south] {$V_{in}$}
(M1.source) node[anchor=south] {} -- (-2,0) -- (2,0)

(2,1) node[nmos, xscale=-1] (M2) {\ctikzflipx{$M_2$}}
(M2.source) node[] {} -- (2,0)
(M2.gate) -- (3,-1) -- (-3,-1)[short, -o] to (-3,0) 

(2,4)node[pmos] (M3) {$M_3$}
(M3.drain) node[] {} -- (M2.drain) node[] {}
(M3.source) node[right] {$source$} -- (2,5);
\end{circuitikz}
\end{center}

\end{document}

The circuit is generated below.

enter image description here

This is what I want to achieve.

enter image description here

2

2 Answers 2

5

I added a named coordinate a (-3,1) for convenience. I switched to standalone to avoid having to crop the image.

\documentclass{standalone}  

\usepackage{tikz}  % for drawing pictures
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{arrows.meta} 

\usepackage[siunitx]{circuitikz} % circuit package and  include electrical units in our labels

\begin{document}

\begin{circuitikz}[american,]
\ctikzset{tripoles/mos style/arrows}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
\path (0,0) -- (2,0); % bounding box

\draw (-3,5)  -- (3,5) node[label=right: $V_{dd} \SI{}{}$] {}
 (-2,1) node[nmos](M1){$M_1$}
 (-2,5) -- (M1.drain)
(-3,1)[short, o-] to (M1.gate)
(M1.source) node[anchor=south] {} -- (-2,0) -- (2,0)

(2,1) node[nmos, xscale=-1] (M2) {\ctikzflipx{$M_2$}}
(M2.source) node[] {} -- (2,0)
(M2.gate) -- (3,-1) -- (-3,-1)[short, -o] to (-3,0) coordinate (A)

(2,4)node[pmos] (M3) {$M_3$}
(M3.drain) node[] {} -- (M2.drain) node[] {}
(M3.source) node[right] {$source$} -- (2,5);

\path (M1.gate) -- (A) node[midway] {$V_{in}$};
%\node at ($(M1.gate)!0.5!(A)$) {$V_{in}$};% alternative
\end{circuitikz}

\end{document}

demo

2

Another possibility, apart from the nice John Kormylo's answer, is to add the voltage to an open bipole:

 (-3,0) to[open, v=$V_{\mathit{in}}$, no v symbols] (M1.gate)

enter image description here

MWE with minimal changes to the OP's code.

\documentclass[12pt,letterpaper]{article}
\usepackage[left=20mm,top=30mm,bottom=30mm,right=20mm]{geometry}

\usepackage{tikz}  % for drawing pictures
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{arrows.meta}


\usepackage[siunitx]{circuitikz} % circuit package and  include electrical units in our labels

\begin{document}

\begin{center}
\begin{circuitikz}[american,]
\ctikzset{tripoles/mos style/arrows}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
\path (0,0) -- (2,0); % bounding box

\draw (-3,5)  -- (3,5) node[label=right: $V_{dd} \SI{}{}$] {}
 (-2,1) node[nmos](M1){$M_1$}
 (-2,5) -- (M1.drain)
(-3,1)[short, o-] to (M1.gate) 
(M1.source) node[anchor=south] {} -- (-2,0) -- (2,0)

(2,1) node[nmos, xscale=-1] (M2) {\ctikzflipx{$M_2$}}
(M2.source) node[] {} -- (2,0)
(M2.gate) -- (3,-1) -- (-3,-1)[short, -o] to (-3,0)
to[open, v=$V_{\mathit{in}}$, no v symbols] (M1.gate)

(2,4)node[pmos] (M3) {$M_3$}
(M3.drain) node[] {} -- (M2.drain) node[] {}
(M3.source) node[right] {$source$} -- (2,5);
\end{circuitikz}
\end{center}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .