6

I am working in this circuit.

enter image description here

I need to circle a part of it, but even after search I could't see how to do it.

enter image description here

The code is:

\documentclass[11pt]{article}
\usepackage{circuitikz}

\begin{document}
\begin{center}
\begin{circuitikz}[american voltages, american currents, european resistors]
\draw (0,0) 
to[V, l=$50$V] (0,2)
to[short, -*] (1.5,2)
to[R, l=$5\Omega$, -*] (3.5,2)
to[cV, l=$10i_\phi$, -*] (5.5,2)
to[short] (7.5,2) (7.5,0)
to[I, i_>=$4A$] (7.5,2) (7.5,0)
to[short] (0,0) (1.5,2)
to[R, l=$40\Omega$, -*] (1.5,0) (3.5,2)
to[R, l=$50\Omega$, -*] (3.5,0) (5.5,2)
to[R, l=$100\Omega$, -*] (5.5,0);
\end{circuitikz}
\end{center}
\end{document}
1
  • 3
    Have you looked at the fit library?
    – cfr
    Apr 8, 2015 at 11:25

1 Answer 1

3

You can use fit library as suggested by cfr. Here is an example:

\documentclass[11pt]{article}
\usepackage{circuitikz}
\usetikzlibrary{fit,shapes.geometric}    %% shapes.geometric needed for ellipse

\begin{document}
\begin{center}
\begin{circuitikz}[american voltages, american currents, european resistors]
\draw (0,0)
to[V, l=$50$V] (0,2)
to[short, -*] (1.5,2)
to[R, l=$5\Omega$, -*] (3.5,2) coordinate (a)
to[cV, l=$10i_\phi$, -*] (5.5,2) coordinate (b)
to[short] (7.5,2) (7.5,0)
to[I, i_>=$4A$] (7.5,2) (7.5,0)
to[short] (0,0) (1.5,2)
to[R, l=$40\Omega$, -*] (1.5,0) (3.5,2)
to[R, l=$50\Omega$, -*] (3.5,0) (5.5,2)
to[R, l=$100\Omega$, -*] (5.5,0);
%\node[draw,red,dashed,ellipse,inner xsep=0pt,inner ysep=3.5mm, fit=(a)(b)]  {};
\node[draw,red,dashed,rounded corners=2ex,inner xsep=5pt,inner ysep=4mm, fit=(a)(b)]  {};
\end{circuitikz}
\end{center}
\end{document}

enter image description here

With

\node[draw,red,dashed,ellipse,inner xsep=0pt,inner ysep=3.5mm, fit=(a)(b)]  {};

uncommented, we get

enter image description here

You must log in to answer this question.

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