0

I am struggling to find these in tikz documentation.

How to label resistor (R above it and 3Ohm below). How to indicate loop current and indicate its direction as shown in the snapshot.

\documentclass{memoir}

\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usetikzlibrary{shapes,fit,arrows}


\begin{document}

    \begin{figure}
        \centering      
    \begin{tikzpicture}[circuit ee IEC, x=3cm,y=4cm,
    thick, 
    every info/.style={font=\footnotesize},
    set resistor graphic=var resistor IEC graphic,
    set diode graphic=var diode IEC graphic,
    set make contact graphic= var make contact IEC graphic]



        \draw (0,0)  to [voltage source={direction info={volt=20}}] ++(0,1);
        \draw (0,1)  to [resistor={info={$R$},ohm=3}]  (2,1);
        \draw (2,1)  to [voltage source ={direction info={volt=10}}]
(2,0);
        \draw (2,0)  to [resistor={info=$R$}] (0,0);    



    \end{tikzpicture}
    \caption{What is current in shown direction}
    \end{figure}

\end{document}

I would like to show loop current as show below

Direction of I

  • Would this help?tex.stackexchange.com/questions/154684/… – Jesse Oct 7 '16 at 7:18
  • Thanks for the reply. In that answer tikz circuits library code was not available. Only point I saw was \node[scale=3]{$\circlearrowright$} using circuitikz. But is there any better one. – Rama Krishna Majety Oct 7 '16 at 7:22
  • Welcome, Yah, I noticed the differences in the library used. As for a better alternative, I don't know, sorry. We have to wait and hope someone will inspire us. :-) – Jesse Oct 7 '16 at 7:33
1

Suffixing ' to some of the circuit keys (e.g., info', ohm' see the manual for details), places the annotation on the other side of the component.

For the arc in the middle, I think drawing it manually is probably the best approach, but here I illustrate the use of a custom annotation with a node:

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{circuits.ee.IEC,calc}
\begin{document}
\begin{tikzpicture}[circuit ee IEC, x=3cm, y=4cm, thick, 
  every info/.style={font=\footnotesize},
  set resistor graphic=var resistor IEC graphic,
  set diode graphic=var diode IEC graphic,
  set make contact graphic= var make contact IEC graphic,
  circuit declare annotation={circular annotation}{0}
    { (270:3/16) edge [to path={ arc (270:0:1/8) } ] () }]

\draw (0,0)  to [voltage source={direction info={volt=20}}] ++(0,1);
\draw (0,1)  to [resistor={info={$R$},ohm'=3}]  (2,1);
\draw (2,1)  to [voltage source ={direction info={volt=10}}] (2,0);
\draw (2,0)  to [resistor={info=$R$}] (0,0);
\node at (1,1/2) [circular annotation] {$I_1$};
\end{tikzpicture}
\end{document}

enter image description here

  • Thanks for perfect reply. Can you give manual arc solution also. – Rama Krishna Majety Oct 7 '16 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.