mpcirc

Introduction

mpcirc is a MetaPost package for drawing electronic diagrams. Its output Postscript files work best when included in TeX files because then the package can fully use TeX's fonts and mathematical typesetting capabilities.

The core of the package is rather stable now but some of the user interface macros (most of them are just syntactic sugar) still need a better design. Right now mpcirc supports two distinct programming styles for drawing diagrams: turtle-based (like circuit_macros), and node-based. In the first one you draw a wire from one point to another, then place an element at its end, then continue at its other end and so on. In the node-based approach the node locations are determined first and then the elements are put between them using betw.x macros.

This second approach arised as I developed a program for automatic conversion from the PSPICE .cir files to the mpcirc format programs.

Some of the element designs were adapted from the circ package.

Some general usage remarks:

Download

Here you can download the main package mpcirc.mp, the library of analog elements circlib.mp, the library of digital elements digital.mp, and the TeX label typesetting definitions ttex.mp.

A primitive PSPICE to mpcirc converter spice2circ (written in Perl5) is also available.

You can also grab a tar file containing the whole directory.

Examples

Click on a diagram to see the corresponding source code.


triangle
flipflop
trafo
Lata
Lata1
elems
digitaltest