# Electric circuits in TeX, LaTeX, and Friends

What are some ways to draw electric circuits in TeX systems?

I'm making this community wiki since I haven't found a question related to this.

I was thinking along the lines of circuitikz. What do you think of that? Other examples are more than welcome, of course.

• I'd be interested to see examples comparing the different approaches, as well. Commented Sep 29, 2010 at 4:55
• Well after a look into the manuals, Circuitikz is the most complete package in term of components.
– s__C
Commented Feb 1, 2013 at 7:54

From version 2.10 on, TikZ has a `circuits` library. It seems to be based on CircuiTikz.

• For those interested, this is an example that uses TikZ `circuits.ee.IEC` library. Commented Oct 13, 2018 at 21:18
• You can also find more information at the PGF manual here (warning: the full manual has more than 1100 pages). Commented Oct 13, 2018 at 21:26

I would recommend circuit macros (https://ece.uwaterloo.ca/~aplevich/Circuit_macros/).

It is not a LaTeX plugin as circuitikz. The circuit drawing makes use of m4 (macro language) and dpic (PIC drawing language) to reach a LaTeX drawing file (e.g. tikz pgf commands actually).

The extra steps gives a lot of power and flexibility. And indeed the circuit symbols in Dwight Aplevich's M4 circuit macros look more pleasing. (https://ece.uwaterloo.ca/~aplevich/Circuit_macros/html/examples.html)

• The biggest disadvantage is the multi-step processing. Besides than that it looks interesting and I'll have a look at it.
– s__C
Commented Jan 31, 2013 at 21:46
• The symbols look cool and the diagrams are beautiful, but the syntax is unintuitive. To place an element, you have to write something like `{R18: resistor(up_ elen_*1.2); llabel(,R_{18}) }` where 1.2 is the vertical shift from the current point (I think). Commented Feb 4, 2013 at 8:40
• Access here and look for Examples and Advanced Examples for a big feature of circuit_macros. There are some souces and some tips. Commented Dec 29, 2014 at 1:40

For users of Asymptote, there seems to be a new package for doing this, discussed here.

• Thanks Will. I've been using Asymptote for a year now and really love it. Although I almost never use it inside of LateX. I generate the image in its own file and import it. Up to now I've been drawing my own circuit elements with it.
– bev
Commented Nov 26, 2010 at 9:57

Have a look at cirkuit. This kde editor for tikZ circuit macros provides live preview, snippets and more.

Since somebody has to do it, it might as well be me. How about TikZ or here?

• Considering that the examples do a `\usepackage{...}`, are these documented in `texdoc pgfmanual`?
– Kit
Commented Oct 4, 2010 at 6:58
• @Kit: I'm not sure. Take a look in the documentation.
– TH.
Commented Oct 4, 2010 at 7:53

I have seen two Metapost-based circuit drawing environments:

1. Tomasz Cholewo's mpcirc, which is a suite of four minimally documented Metapost libraries to support writing Metapost to layout circuits. The examples are impressively compact, but I don't understand the code;
2. Gustavo Argañaraz' makecirc, which is a pair of Metapost libraries, to handle circuit layout and creating Latex labels. The code is much more what one would expect, and there is a user guide.

Makecirc is somewhat tied to Latex, because its label creation library uses latex-specific code to create parametric label ranges. Mpcirc should work with Context.

You may also want to have a look the pst-circ package from the pstricks family.

My guess would be to actually use a normal cad program, and then export into a format that could be used by LaTeX (and friends). Preferable a format like svg (scalable vector graphics) so that you could zoom in the resulting pdf.

I checked over at chiphacker for cad programs:

And maybe kicad can be useful since that seem to have svn export, but I have not tried it my self.

• The usual reasons for wanting to do figures from a tex-aware programme apply. 1) You want the fonts and line-weights of the labels to match with the body text; 2) You want to be able to use tex mathmode facilities for the labelling; 3) You want to be able to use macros for the labels so you can redefine your notation for the whole document with a single change to a `\newcommand`. A normal CAD programme + export to eps + psfrag may work, but is generally more work than you would like, due to fine-tuning positioning of labels. Commented Sep 29, 2010 at 15:24