Circuit_macros, Version 10.6

Tools for drawing electric circuits and other line diagrams.

From the README file:

This is a set of macros for drawing high-quality line diagrams to include in TeX, LaTeX, web, or similar documents, with support for SVG and other formats. Fundamental electric circuit elements and basic logic gates based on IEEE and European standards are included, with several tools and examples of other types of diagrams. Elements can be scaled or drawn in any orientation and are easy to modify. The advantages and disadvantages of such a system are similar to those of TeX itself, which is macro-based and non-WYSIWYG, with ordinary text input.

The simplicity and power of m4 macros is employed to produce drawing commands in the pic "little language," which is easy to read and learn. The diagram is then automatically translated into TiKZ, PSTricks, or other formats for processing by LaTeX or other applications. Free, open-source interpreters for m4 and pic are readily available. This process is well suited to line drawings requiring parametric or conditional components, fine adjustment, significant geometric calculations, repetition, or recursion. Arbitrary text or other objects such as tables for formatting by LaTeX can be placed at will in the diagram.

Changes in this version are summarized here

Example diagrams can be viewed as html with links to the diagram sources, or as a pdf document.

To draw your own diagrams using this method, you need the following components:

  1. A pic interpreter: The dpic interpreter was used to process these diagrams. Dpic produces output in the following formats:
    • TikZ PGF format (powerful, flexible, used with pdflatex)
    • PSTricks format (powerful, flexible, used with LaTeX)
    • SVG (for the web and Inkscape)
    • encapsulated Postscript, raw text
    • encapsulated Postscript, psfrag text
    • xfig format
    • PDF format, raw text
    • basic LaTeX graphics (limited capabilities)
    • LaTeX pict2e graphics
    • eepicemu format
    • mfpic format
    • MetaPost format

    The file processing sequence is typically to convert m4 source to pic statements and then to PSTricks or TikZ drawing commands, resulting in a .tex file for inclusion in a LaTeX document. The dpic interpreter is available as a git repository at or in source form. A PC executable is also available. Several Linux distributions make versions of dpic available. GNU pic, sometimes called gpic, is an alternative that uses tpic specials (see the readme file). Some of the examples in this distribution require dpic.

  2. An m4 macro processor:
    Pic interpreters include basic macro facilities, but the circuit macros and these examples extend the pic language using the more powerful m4 macro processor, which is available for Unix-like systems and Macs. PC source and executables can be obtained at least as follows:
    • from the Cygwin site (Cygwin resources are recommended for managing the production of complex LaTeX docunents on a PC).
    • from the sourceforge site.

  3. The Circuit_macro distribution: The complete distribution is available See the Circuit_macros CHANGES file for differences between versions.

Detailed instructions are given in the README file and in the user's manual Circuit_macros.pdf.