25

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.

2
  • I'd be interested to see examples comparing the different approaches, as well. Commented Sep 29, 2010 at 4:55
  • 1
    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

8 Answers 8

11

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

2
  • For those interested, this is an example that uses TikZ circuits.ee.IEC library.
    – evaristegd
    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).
    – evaristegd
    Commented Oct 13, 2018 at 21:26
8

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)

3
  • 1
    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).
    – Luigi
    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.
    – jotagah
    Commented Dec 29, 2014 at 1:40
6

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

1
  • 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
6

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

cirkuit

5

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

2
  • 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
5

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.

4

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

-1

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.

1
  • 10
    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.
    – Lev Bishop
    Commented Sep 29, 2010 at 15:24

You must log in to answer this question.

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