如何使用 circuitikz 制作文本框?

如何使用 circuitikz 制作文本框?

我想解释戴维南定理,我想制作这样的盒子。这可能吗,还是我必须使用额外的包装?我该怎么做?

在此处输入图片描述

答案1

像这样:

在此处输入图片描述

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{positioning}

\begin{document}
    \begin{circuitikz}[american, 
node distance = 24mm,
     N/.style = {draw=teal, thick, align=left, minimum height=24mm}
                        ]
\ctikzset{voltage/american font=\tiny,
         }
          bipole current style/.style={line width=1pt}
\draw   (0,0)   node [N] (in) {Linear\\ two-terminal\\ circuit}
            ([yshift=+6mm] in.east) coordinate (in-a)
            ([yshift=-6mm] in.east) coordinate (in-b)
                node [N, right=of in] (out) {load} 
        (in-a)  to [short,color=purple,f=$I$,-o]
                    ++ (1.6,0) coordinate[label=above:$a$] (a)-- (a -| out.west)
        (in-b)  to [short,color=purple,-o]  
                    ++ (1.6,0) coordinate[label=below:$b$] (b)-- (b -| out.west)
        (a)     to [open,v=$V$] (b)
        ;
    \end{circuitikz}
\end{document}

答案2

这会是您的起点吗?

\documentclass[tikz]{standalone}
\usepackage[oldvoltagedirection]{circuitikz}
\usetikzlibrary{calc}

\begin{document}
\begin{circuitikz}[american voltages] \draw (0,0)
  node[draw,minimum width=2cm,minimum height=2.4cm] (load) {Load}
  ($(load.west)!0.75!(load.north west)$) coordinate (la)
  ($(load.west)!0.75!(load.south west)$) coordinate (lb)
  (lb) to[short,-o] ++(-0.5,0) coordinate (b) node[below] {$b$}
  to[short] ++(-4,0) coordinate (VThb)
  to[V=$V_{\mathrm{Th}}$] (VThb |- la)
  to[R=$R_{\mathrm{Th}}$] ++(2.5,0) coordinate (VTht)
  to[short,-o,i=$I$] (VTht -| b) coordinate (a) node[above] {$a$}
  to[short] (la);
  \path (a) node[below] {$+$} -- node {$V$} (b) node[above]   {$\vphantom{+}-$};
\end{circuitikz}
\end{document}

相关内容