电路是怎样的:
我尝试使用 来\begin{circuitikz}[american voltages, baseline=(current bounding box.base)]
代替,\begin{circuitikz}[american voltages, baseline=(current bounding box.center)]
但是 \leftrightarrow 仍处于错误的位置。
完整代码:
\documentclass[11pt]{article}
\usepackage{circuitikz}
\usepackage{tikz} % for flowcharts
\begin{center}
\begin{circuitikz}[american voltages, baseline=(current bounding box.center)]
\ctikzset { label/align = straight }
\draw (0,0)
to[sV_<=$\hat{V_S}$] (0,-2)
to[short, -o] (3,-2)
(0,0) to [fullgeneric, l=$\hat{Z_S}$, -o] (3,0)
{[anchor=west] (3,0) node {a} [anchor=west] (3,-2) node{b}};
\end{circuitikz}
$\hspace{0.25in} \displaystyle \Leftrightarrow \hspace{0.25in}$
\begin{circuitikz}[american voltages, baseline=(current bounding box.center)]
\ctikzset { label/align = straight }
\draw (0,0)
to[sI=$\hat{I_S}$] (0,-2)
to[short, -o] (3,-2)
(0,0) to[short, -*] (2,0)
to [fullgeneric, l=$\hat{Z_S}$, -*] (2,-2)
(2,0) to [short, -o] (3,0)
{[anchor=west] (3,0) node {a} [anchor=west] (3,-2) node{b}};
\end{circuitikz}
\end{center}
\end{document}
答案1
由于电路的高度不同,最简单的方法似乎是手动校正它们的位置,例如:
\documentclass[11pt]{article}
\usepackage{circuitikz}
\usepackage{tikz} % for flowcharts'
\begin{document}
%\begin{center}
\begin{tabular}{ccc}
\begin{tabular}{c}
\begin{circuitikz}[american voltages, baseline=(current bounding box.center)]
% \ctikzset { label/align = straight }
\draw (0,0)
to[sV_<=$\hat{V_S}$] (0,-2)
to[short, -o] (3,-2)
(0,0) to [fullgeneric, l=$\hat{Z_S}$, -o] (3,0)
{[anchor=west] (3,0) node {a} [anchor=west] (3,-2) node{b}};
\end{circuitikz}
\end{tabular}
&
\begin{tabular}{c}
\\[5mm]
$\hspace{0.25in} \displaystyle \Leftrightarrow \hspace{0.25in}$
\end{tabular}
&
\begin{tabular}{c}
\\[5mm]
\begin{circuitikz}[american voltages, baseline=(current bounding box.center)]
% \ctikzset { label/align = straight }
\draw (0,0)
to[sI=$\hat{I_S}$] (0,-2)
to[short, -o] (3,-2)
(0,0) to[short, -*] (2,0)
to [fullgeneric, l=$\hat{Z_S}$, -*] (2,-2)
(2,0) to [short, -o] (3,0)
{[anchor=west] (3,0) node {a} [anchor=west] (3,-2) node{b}};
\end{circuitikz}
% \end{center}
\end{tabular}
\end{tabular}
\end{document}