# How can I add a box in an electric circuit?

I'm working in this ciruit:

I googled how to make a box like this (Load box) but I didn't find any similar example. What I found of more similar was to use a nport but with no examples. Does someone has one good example or know how to make this circuit above?

Here what I've done:

\documentclass[11pt]{article}
\usepackage{circuitikz}
\usepackage{tikz}                           % for flowcharts
\begin{document}

\begin{center}
\begin{circuitikz} [american voltages, baseline=(current bounding box.center)]
\ctikzset { label/align = straight }
\draw (0,0)
to[V=$V_{Th}$] (0,2)
to[R=$R_{Th}$] (2.5,2)
to[short,i=$I$, -o] (4,2)
to[short] (4.5,2)
(0,0) to[short, -o] (4,0)
to[short] (4.5,0);
\end{circuitikz}
\end{center}
\end{document}


• Similar examples: Making FFT Figure using LaTeX Tikz, Tikz surrounding box with automatically drawn border “ports”. I guess, a proper definition is in order. You can also mis-use the European gates replacing the actual text and use only the first and last input anchor. — In this case it might be just the easiest to add a simple rectangular node to the right of your two lines. Commented Apr 26, 2015 at 13:53
• Add \node[draw,minimum width=2cm,minimum height=2.4cm,anchor=south west] at (4.5,-0.2){Load}; to your code.
– user11232
Commented Apr 26, 2015 at 14:07
• Alternatively, one can simply place a node (rectangle) where you want it and specify contact points using, for example, ($(name.north west)!.25!(name.south west)$) with the calc library. Commented Apr 26, 2015 at 15:40
• Simply adding the line @HarishKumar provided works for me. What's the problem exactly?
– cfr
Commented Apr 26, 2015 at 22:11
• Leave the semicolon after to[short] (4.5,0); and then add the line. You are just missing the ; is all.
– cfr
Commented Apr 26, 2015 at 22:46

Based on Harish Kumar's comment:

\documentclass[tikz,border=5pt]{standalone}
\usepackage{circuitikz}
\begin{document}

\begin{circuitikz} [american voltages, baseline=(current bounding box.center)]
\ctikzset { label/align = straight }
\draw (0,0)
to[V=$V_{Th}$] (0,2)
to[R=$R_{Th}$] (2.5,2)
to[short,i=$I$, -o] (4,2)
to[short] (4.5,2)
(0,0) to[short, -o] (4,0)
to[short] (4.5,0);
\node[draw,minimum width=2cm,minimum height=2.4cm,anchor=south west] at (4.5,-0.2){Load};
\end{circuitikz}

\end{document}

• @HarishKumar I would have suggested you answer but it was 8 hours since your comment and all the OP needed was a semicolon... If you want to post an answer, I'm happy to delete this. It was really just for temporary demonstration purposes.
– cfr
Commented Apr 26, 2015 at 23:34
• no problem. I will be happy if you can convert it in to non-community wiki.
– user11232
Commented Apr 26, 2015 at 23:54
• To clutter this space, BTW, cfr-initials works flawlessly so far in my certificates adventure. It is in miktex already. Thanks for the package. :-)
– user11232
Commented Apr 27, 2015 at 0:01
• @HarishKumar To clutter further: Excellent! However, I don't think it is possible to un-CW a post...
– cfr
Commented Apr 27, 2015 at 0:02

cfr provided the basic answer that will get you up and running quickly with your existing code. But I provide this answer so you can see some ideas you might find useful in the future.

Here's another way of drawing the circuit without manually specifying the coordinates. It's a little bit more typing at the beginning, but if you decide later to change the size of some component, the whole drawing updates itself to reflect that. There's no extra work needed to update the coordinates:

\documentclass[tikz]{standalone}
\usepackage[oldvoltagedirection]{circuitikz}
\usetikzlibrary{calc}

\begin{document}
\begin{circuitikz}[american voltages] \draw (0,0)
($(load.west)!0.75!(load.north west)$) coordinate (la)
($(load.west)!0.75!(load.south west)$) coordinate (lb)
(lb) to[short,-o] ++(-0.5,0) coordinate (b) node[below] {$b$}
to[short] ++(-4,0) coordinate (VThb)
to[V=$V_{\mathrm{Th}}$] (VThb |- la)
to[R=$R_{\mathrm{Th}}$] ++(2.5,0) coordinate (VTht)
to[short,-o,i=$I$] (VTht -| b) coordinate (a) node[above] {$a$}
to[short] (la);
\path (a) node[below] {$+$} -- node {$V$} (b) node[above] {$\vphantom{+}-$};
\end{circuitikz}
\end{document}


Note also that I've used \mathrm{Th} for the subscripts, because Th doesn't represent a pair of variables but an abbreviation for a person's name.

• For some reason if I put your code into overleaf the voltage source is turned upside down Commented Oct 9, 2021 at 15:47
• Thanks for the note @Vinzent, it looks like the default directions were swapped in newer versions of circuitikz. I've updated the post with the compatibility switch. Commented Nov 12, 2021 at 21:07