# How to circle one part in an electric circuit?

I am working in this circuit.

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

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}

• Have you looked at the fit library?
– cfr
Apr 8, 2015 at 11:25

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}


With

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


uncommented, we get