Typesetting Petri Nets

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?

One Response to Typesetting Petri Nets

  1. Chris B says:

    I’ve found dot2tex to be very useful for automata and other LTSs in the past. Though, again, it’s difficult to get it to adjust the layout to anything other than that which it chooses… It does pretty well at the layout until you start drawing /really/ complicated stuff though. You can choose the graph layout algorithm that it uses which gives a bit of flexibility.

    I’m not sure how well this would translate to drawing Petri Nets, but I imagine it would do a pretty good job. You just need to specify two different kind of node (circles and boxes for places and transitions).