![如何将文本放在 M1 门底部的 Vin 处](https://linux22.com/image/472051/%E5%A6%82%E4%BD%95%E5%B0%86%E6%96%87%E6%9C%AC%E6%94%BE%E5%9C%A8%20M1%20%E9%97%A8%E5%BA%95%E9%83%A8%E7%9A%84%20Vin%20%E5%A4%84.png)
以下是我的代码。
\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}