右側にラベルがある Circuitikz

右側にラベルがある Circuitikz

すべてのコンポーネント値を回路の右側に配置しようとしています。circuitikz でラベル ノードを使用するソリューションを見たことがありますが、2 つを分離することを好みます。

私が思いついたのは、次のことだけです。ラベルを回路の横の上部または中央に垂直に配置する必要があります。

\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計測単位のパッケージを使用することを強くお勧めします。μはマイクロファラッドでない数学モードになります...

関連情報