0

How do I display "R_1" INSIDE the resistor, AND showing the value outside the resistor?

\documentclass[]{standalone}
\usepackage{circuitikz, siunitx}
\begin{document}
    \begin{circuitikz}[european]
        \draw
            (0,0)   to  [short, i=\(I_1\), -*]                      (1,0)
                    to  [short, i=\(I_3\)]                      ++  (1,0)
                    to  [R, l=\(R_2\), label=\(\SI{10}{\ohm}\)] ++  (2,0)
                    to  [short, -*]                             ++  (1,0)
                    to  [short, i=\(I_5\)]                      ++  (1,0);
        \draw
            (0,0)   to  [battery1, l_=\(V_1\)]                  ++  (0,-3);
        \draw
            (5,0)   to  [R, l=\(R_3\), label=\(\SI{2}{\ohm}\)]  ++  (0,-2)
                    to  [short, i=\(I_4\), -*]                  ++  (0,-1)
                    to  [short]                                 ++  (1,0)
                    to  [battery1, l_=\(V_2\)]                  ++  (0,3);
        \draw
            (5,-3)  to  [short, i=\(I_6\)]                      ++  (-5,0);
        \draw
            (1,0)   to  [R, l=\(R_1\), label=\(\SI{5}{\ohm}\) ] ++  (0,-2)
                    to  [short, i=\(I_2\), -*]                  ++  (0,-1)
                    to  [short]                                 ++  (-1,0);
    \end{circuitikz}
\end{document}

How do I turn THISinto THIS?

  • Maybe https://tex.stackexchange.com/questions/536021/position-labels-inside-circuitikz-reisistors can help? You can use l= and a= for the external text, and manually add the text nodes at the center as shown there. – Rmano Mar 03 '24 at 17:58

1 Answers1

2

You have more info (and my reasoning why it's a bad idea) here; anyway, given that in that answer there are no both labels together, for example:

\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\begin{tikzpicture}[european]
    \draw (0,0) to[R=\qty{5}{\ohm},name=vr1] ++(0,-2);
    \node [rotate=90, font=\scriptsize] at (vr1.center) {$R_1$};
\end{tikzpicture}
\end{document}

enter image description here

Rmano
  • 40,848
  • 3
  • 64
  • 125