Tomasz Cholewo's Home Page
Home
Resume
Publications
Software
  Mathematica
  Haskell
  C, C++, Java
  LaTeX
  Perl
  Elisp
  Script-Fu
  Configuration Files
  Miscellaneous
Photos

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, 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:

  • element names using R._. are forbidden because this notation is reserved for element type variables
  • use `save R' in subcircuits
  • has general affine transformations
  • doesn't work with R[0][0]
  • index 01 is equivalent to 1
  • case sensitive
  • don't use prepare outside beginfig

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 mpcirc.tar.gz tar file containing the whole directory.

Examples
Click on a diagram to see the corresponding source code.


triangle
flipflop
trafo
Lata
Lata1
elems
digitaltest

Website META Language
Almost Valid HTML 4.0!


This page (http://ci.uofl.edu/tom/software/LaTeX/mpcirc/) was most recently modified on Aug 6, 19101.