2

I'm trying to put all component values on the right side of the circuit. I have seen solutions with using label nodes in circuitikz but prefer to separate the two.

I have only been able to come up with the following. I need to either put the labels at the top or center-vertically next to the circuit.

\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}

enter image description here

4
  • 1
    I am not sure I understand. To change side for R_C label, for example, just do to[R, l_=$R_C$] or to[R, l^=$R_C$] --- is that what you looked for? (Which of the two depends on the direction of the path, I didn't check). Or are you referring to the list of values on the right side (commented as left side in the code?)?
    – Rmano
    Apr 18 at 7:30
  • @Rmano Sorry I don't know how to explain but I want to make a 'List' of the components on the right side of the circuit as shown with (R1, C1, L1) not move each component label. (My bad for the comment) Hope it clarifies :)
    – NicoAnde
    Apr 18 at 7:37
  • 2
    Besides [t] alignment, you also need to alter a baseline of the circuitikz. If you want values on the right-hand side to appear in the middle, append baseline={(current bounding box.center)} to circuitikz options (after europeam followed by comma). If you want them at the top, append baseline={(current bounding box.north)}, instead. For extra vertical tuning, insert yshift=<unit> to the baseline itself, e.g. baseline={([yshift=-12pt]current bounding box.north)}.
    – Celdor
    Apr 18 at 8:15
  • @Celdor Find it to be the best solution so far, Thanks for your help!
    – NicoAnde
    Apr 18 at 8:34

1 Answer 1

5

Ah, I got it. What I normally do is choose an element in the circuit drawing, name it (naming the node or the element), and then align the table to the baseline of that element. For example, in the following, the table is aligned with the +V_CC node:

\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}

enter image description here

Or, for example, with the R_C label:

\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}

enter image description here

BTW: I warmly suggest to use the siunitx package for measurement units. That μ in microfarad should not be in math mode...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .