0

So I am trying to create a very simple circuit. Here is my code:

\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage{circuitikz,siunitx}% cfr: these seem necessary but what else?
\standaloneenv{circuitikz}
\begin{document}
\ctikzset{bipoles/resistor/height=0.15}
\ctikzset{bipoles/resistor/width=0.4}
\begin{circuitikz}
  \draw (0,0)
  to[I,i=$1 \mA$,] (0,5) % The voltage source
  to[short] (0,5)
  to[short] (4,5) % The resistor
  to[R=$ 1\kilo\ohm$,] (4,0) % The resistor
  to[short] (0,0);
  \draw (4,5)
  to[R=$1\kilo\ohm$] (8,5) % The resistor
  %to[short] (8,5)
  to[R=$10 \kilo\ohm$] (8,0) % The voltage source
  to[short] (0,0);
  \draw (8,5)
  to[R=$1 \kilo\ohm$] (14,5) % The voltage source
  to[R=$1 \kilo\ohm $]  (14,3)
  to[cV=$A V_{in} $]  (14,0)
  to[short] (0,0);
  \draw (10,5)
  to[short] (16,5) node[anchor=west]{A}
  to [open,o-o] (16,0)node[anchor=west]{B}
  to[short] (0,0);
  \draw [red,latex-] (2,2) node[above,color=red]{$i_2$} arc(-90:145:5mm)
\end{circuitikz}
\end{document}

All that I would like to do is be able to write i_1, i_2,i_3 inside the drawn thin circle to denote current flowing throughout enouch mesh.

When I try to put a circle arrow, I get an error.

4
  • 1
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Fran
    Aug 12, 2016 at 19:03
  • See, if my answer on question tex.stackexchange.com/questions/324583/… can help you
    – Zarko
    Aug 12, 2016 at 19:37
  • I'm having trouble trying to turn your code into a complete MWE. I've added circuitikz and siunitx to the preamble, but I'm still getting undefined control sequences. What do I need to load in addition? Also, what should enouch say?
    – cfr
    Aug 13, 2016 at 0:07
  • Maybe siunitx doesn't even help. I get a different error, but at the same line.
    – cfr
    Aug 13, 2016 at 0:14

2 Answers 2

1

I spent a lot of time getting your code to compile, so perhaps the fact that I don't understand the question now I've compiled it is only to be expected. I don't know how a circle can be 'thin'. I thought you might mean an ellipse, but there doesn't seem to be one.

So maybe you want to add i_1 and i_3 to the circle containing i_2. I wondered if you wanted additional circles, but that wouldn't make sense. If you know how to make one, you could obviously make another two. So I can only think the problem is to add additional labels on the same circle.

Something like this:

more labels

\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage[siunitx,european]{circuitikz}
\usetikzlibrary{arrows.meta}
\standaloneenv{circuitikz}
\begin{document}
\ctikzset{bipoles/resistor/height=0.15}
\ctikzset{bipoles/resistor/width=0.4}
\begin{circuitikz}[european currents]
  \draw (0,0)
  to [I, i=1<\milli\ampere>] (0,5) % The voltage source
  to [short] (0,5)
  to [short] (4,5) % The resistor
  to [R=1<\kilo\ohm>] (4,0) % The resistor
  to [short] (0,0)
  (4,5)
  to [R=1<\kilo\ohm>] (8,5) % The resistor
  to [R=10<\kilo\ohm>] (8,0) % The voltage source
  to [short] (0,0)
  (8,5)
  to [R=1<\kilo\ohm>] (14,5) % The voltage source
  to [R=1<\kilo\ohm>]  (14,3)
  to [cV=$A V_{in} $]  (14,0)
  to [ short] (0,0)
  (14,5)
  to [short] (16,5) node [anchor=west] {A}
  to [open, o-o] (16,0) node [anchor=west] {B}
  to [short] (0,0);
  \draw [red, Latex-] (2,2) node [above] {$i_3$} arc (-90:145:5mm) node [midway, left] {$i_2$} node [near end, below left] {$i_1$};
\end{circuitikz}
\end{document}
2
  • Sorry, I don't write a good explanation, I want to draw something like this link
    – PCat27
    Aug 13, 2016 at 3:14
  • Try replacing \draw [red, Latex-] (2,2) node [above] {$i_3$} arc (-90:145:5mm) node [midway, left] {$i_2$} node [near end, below left] {$i_1$}; with \draw [red, Latex-] (2,2) arc (-90:145:5mm) node [midway, below left] {$i_1$}; \draw [red, Latex-] (6,2) arc (-90:145:5mm) node [midway, below left] {$i_2$}; \draw [red, Latex-] (11,2) arc (-90:145:5mm) node [midway, below left] {$i_3$};
    – Dai Bowen
    Aug 13, 2016 at 11:03
0
\documentclass{article}
     \usepackage{graphicx}
     \usepackage[american]{circuitikz}
      \usetikzlibrary{arrows.meta}
       \usepackage{amsmath}
       \usepackage{amsthm}
         \usepackage{amsfonts}
   \usepackage[free-standing-units]{siunitx}

    \begin{document}
   \begin{figure}
 \begin{center}
 \ctikzset{bipoles/resistor/height=0.15}
\ctikzset{bipoles/resistor/width=0.4}
\begin{circuitikz}[scale=0.7]
 \draw (0,0)
      to[I,i=$1 \mA$,] (0,5) 
      to[short] (0,5)
      to[short] (4,5)     
      to[R=$ 100\ohm$,] (4,0) 
      to[short] (0,0);          
\draw (4,5)          
     to[R=$1\kilo\ohm$] (8,5) 
     to[R=$1 \kilo\ohm$] (8,0)
     to[short] (0,0);       
  \draw (8,5) 
      to[R=$10 \kilo\ohm$] (14,5)
      to[R=$1 \kilo\ohm $]  (14,3)         
      to[cV=$A V_{i} $]  (14,0)
      to[short] (0,0);     
 \draw (10,5)         
     to[short] (16,5) node[anchor=west]{A}
     to [open,o-o] (16,0)node[anchor=west]{B}
     to[short] (0,0);
\draw [red, Latex-] (2,2) arc (-90:175:5mm) node [midway, below left]                {$i_1$};
\draw [red, Latex-] (6.3,2) arc (-90:175:5mm) node [midway, below left]         {$i_2$}; 
 \draw [red, Latex-] (11,2) arc (-90:175:5mm) node [midway, below left]             {$i_3$};
\end{circuitikz}
\label{1.1}

\end{center} \end{figure} \end{document}

You must log in to answer this question.

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