Circuitikz 右側有標籤

Circuitikz 右側有標籤

我試圖將所有元件值放在電路的右側。我已經看到在 Circuitikz 中使用標籤節點的解決方案,但更喜歡將兩者分開。

我只能想出以下內容。我需要將標籤放在電路的頂部或垂直中心位置。

\documentclass{article}
\usepackage{amsmath}
\usepackage{circuitikz}

\begin{document}

\begin{table}[h]
\centering
\begin{tabular}{|c|c|}
\begin{circuitikz}[european]
\draw (0,0)
    node[tlground]{} % The ground
    to[V, v^<=$U_0$] (0,2) % The voltage source
    to[C, l=$C_1$] (2,2) % The capacitor
    to[R=$R_B$] (2,5); % The resistor
\draw
    (4,2) node[npn, tr circle] (Q1) {} % The transistor
    (Q1.base) to[short] (2,2) % The short
    (Q1.collector) to[R=$R_C$] (4,5) % The resistor
    (4,3) to[short] (5,3) % The short
    node[label={[font=\footnotesize]right:$V_{out}$}] {}
    (Q1.emitter) to[short] (4,0) % The short
    node[tlground]{};
\draw (0,5)
    node[label={[font=\footnotesize]left:$+V_{cc}$}] {}
    to[short] (5,5);
\end{circuitikz}

&

% Add labels for component values on the right side
\begin{tabular}[t]{l}
    $R_1 = 1\text{k}\Omega$\\
    $C_1 = 10\mu\text{F}$\\
    $L_1 = 100\text{mH}$
\end{tabular}
\end{tabular}
\end{table}

\end{document}

在此輸入影像描述

答案1

啊,我明白了。我通常做的是在電路圖中選擇一個元素,為其命名(命名節點或元素),然後將表格與該元素的基線對齊。例如,在下面,表格與 +V_CC 節點對齊:

\documentclass{article}
\usepackage{amsmath}
\usepackage{circuitikz}

\begin{document}

\begin{table}[h]
\centering
\begin{tabular}{|c|c|}
\begin{circuitikz}[european, baseline=(REF.base)]
\draw (0,0)
    node[tlground]{} % The ground
    to[V, v^<=$U_0$] (0,2) % The voltage source
    to[C, l=$C_1$] (2,2) % The capacitor
    to[R=$R_B$] (2,5); % The resistor
\draw
    (4,2) node[npn, tr circle] (Q1) {} % The transistor
    (Q1.base) to[short] (2,2) % The short
    (Q1.collector) to[R=$R_C$] (4,5) % The resistor
    (4,3) to[short] (5,3) % The short
    node[label={[font=\footnotesize]right:$V_{out}$}] {}
    (Q1.emitter) to[short] (4,0) % The short
    node[tlground]{};
\draw (0,5)
    node[label={[font=\footnotesize]left:$+V_{cc}$}](REF) {}
    to[short] (5,5);
\end{circuitikz}

&

% Add labels for component values on the right side
\begin{tabular}[t]{l}
    $R_1 = 1\text{k}\Omega$\\
    $C_1 = 10\mu\text{F}$\\
    $L_1 = 100\text{mH}$
\end{tabular}
\end{tabular}
\end{table}

\end{document}

在此輸入影像描述

或者,例如,使用 R_C 標籤:

\documentclass{article}
\usepackage{amsmath}
\usepackage{circuitikz}

\begin{document}

\begin{table}[h]
\centering
\begin{tabular}{|c|c|}
\begin{circuitikz}[european, baseline=(REFlabel.base)]
\draw (0,0)
    node[tlground]{} % The ground
    to[V, v^<=$U_0$] (0,2) % The voltage source
    to[C, l=$C_1$] (2,2) % The capacitor
    to[R=$R_B$] (2,5); % The resistor
\draw
    (4,2) node[npn, tr circle] (Q1) {} % The transistor
    (Q1.base) to[short] (2,2) % The short
    (Q1.collector) to[R=$R_C$, name=REF] (4,5) % The resistor
    (4,3) to[short] (5,3) % The short
    node[label={[font=\footnotesize]right:$V_{out}$}] {}
    (Q1.emitter) to[short] (4,0) % The short
    node[tlground]{};
\draw (0,5)
    node[label={[font=\footnotesize]left:$+V_{cc}$}] {}
    to[short] (5,5);
\end{circuitikz}

&

% Add labels for component values on the right side
\begin{tabular}[t]{l}
    $R_1 = 1\text{k}\Omega$\\
    $C_1 = 10\mu\text{F}$\\
    $L_1 = 100\text{mH}$
\end{tabular}
\end{tabular}
\end{table}

\end{document}

在此輸入影像描述

順便說一句:我強烈建議使用該siunitx套件作為測量單位。 µ 微法拉應該不是處於數學模式...

相關內容