2

I'm trying to draw a simple example circuit:

\documentclass[a4paper,oneside,titlepage]{article} 
\usepackage[utf8]{inputenc}
\usepackage[siunitx]{circuitikz}
\usepackage{tikz}
\usepackage{siunitx}

\begin{document}
\begin{circuitikz}[scale=1.4]\draw
 (0,0) to[C, l=\SI{10}{\micro\farad}] (0,2) -- (0,3)
 to[R, l=\SI{2.2}{\kilo\ohm}] (4,3) -- (4,2)
 to[L, l=\SI{12}{\milli\henry}, i=$i_1$] (4,0) -- (0,0)
 (4,2) to[D*, *-*] (2,0) to [D*, -*] (0,2)
 to[R, l=\SI{1}{\kilo\ohm}] (2,2) to[cV, v=\SI{0.3}{\kilo\ohm} $i_1$] (4,2)
 (2,0) to[I, i=\SI{1}{\milli\ampere}, -*] (2,2)
;
\end{circuitikz}
\end{document}

and I have a problem about the label of the current generator 'I': the presence of the two components (diodes) both on its right and left does not allow the label to be shown properly, overlapping the diodes.

I would like the label to be positioned like the following figure:

enter image description here

(from this page)

In that case, for the 'I' component, this line has been used:

(2,0) to[I, i=$1\milli\ampere$:15, -*] (2,2)

where you can see the :15 directive, which in my case cannot be used (error). I suppose this is due to the package version.

I hope I gave all the possible details to understand and reproduce the problem.

1
  • Add a text label after the semicolon: \path (2,1) node [outer sep=1.3mm, label=120:\SI{1}{mA}] {};
    – Luigi
    Commented May 20, 2013 at 8:02

1 Answer 1

1

Is that about right? Are you sure it wouldn't be easier just to stick a node with text where you want it?

\documentclass[a4paper,oneside,titlepage]{article} 
\usepackage[utf8]{inputenc}
\usepackage[siunitx]{circuitikz}
\usepackage{tikz}
\usepackage{siunitx}

\begin{document}
\begin{circuitikz}[scale=1.4]\draw
 (0,0) to[C, l=\SI{10}{\micro\farad}] (0,2) -- (0,3)
 to[R, l=\SI{2.2}{\kilo\ohm}] (4,3) -- (4,2)
 to[L, l=\SI{12}{\milli\henry}, i=$i_1$] (4,0) -- (0,0)
 (4,2) to[D*, *-*] (2,0) to [D*, -*] (0,2)
 to[R, l=\SI{1}{\kilo\ohm}] (2,2) to[cV, v=\SI{0.3}{\kilo\ohm} $i_1$] (4,2)
 (2,0) to[I, i=\raisebox{1.2cm}{\SI{1}{\milli\ampere}\hspace{-0.3cm}},  -*]     (2,2)
;
\end{circuitikz}
\end{document}

Also, the ne anchor point should be in the vicinity.

\documentclass[a4paper,oneside,titlepage]{article} 
\usepackage[utf8]{inputenc}
\usepackage[siunitx]{circuitikz}
\usepackage{tikz}
\usepackage{siunitx}

\begin{document}
\begin{circuitikz}[scale=1.4]\draw
 (0,0) to[C, l=\SI{10}{\micro\farad}] (0,2) -- (0,3)
 to[R, l=\SI{2.2}{\kilo\ohm}] (4,3) -- (4,2)
 to[L, l=\SI{12}{\milli\henry}, i=$i_1$] (4,0) -- (0,0)
 (4,2) to[D*, *-*] (2,0) to [D*, -*] (0,2)
  to[R, l=\SI{1}{\kilo\ohm}] (2,2) to[cV, v=\SI{0.3}{\kilo\ohm} $i_1$] (4,2)
 (2,0) to[I, n=si1, -*] (2,2)
 (si1.ne) node[above]{\SI{1}{\milli\ampere}}
;
\end{circuitikz}
\end{document}

You must log in to answer this question.

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