如何将文本放在 M1 门底部的 Vin 处

如何将文本放在 M1 门底部的 Vin 处

以下是我的代码。

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

电路生成如下。

在此处输入图片描述

这就是我想要实现的目标。

在此处输入图片描述

答案1

为了方便起见,我添加了一个名为 a (-3,1) 的坐标。我切换到独立模式以避免裁剪图像。

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

演示

答案2

除了好之外,还有另一种可能性John Kormylo 的回答,就是将电压添加到open双极子上:

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

在此处输入图片描述

MWE 对 OP 的代码做了最少的改动。

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

相关内容