Typesetting Petri Nets

18 February 2010

Donal asked about typesetting Petri nets. I’m using the LaTeX style PGF/TikZ; this renders things well, and plays nicely with the beamer class for creating slides. These are ridiculously extensive packages, both written by Till Tantau — I cannot imagine how he finds the time.

TikZ works with moderately high-level descriptions of diagrams: for Petri nets, once the location of places and transitions are set it will draw the links between them, according to suitable styling instructions. It also works entirely within TeX, which is a help for portability. (We’ll leave aside the issue of whether trigonometric computation is a sensible task to attempt in a language designed for text preparation.)

Browse the gallery of TikZ examples to see what can be done. There are even PDF animations, like this one of set intersection (source code).

I have no plans to animate my Petri nets, although I’m sure it could be done.

Chris said he had experience with dot2tex, which I have not used.

Any other suggestions on good ways to draw Petri nets?