[Tex/LaTex] Including LaTeX vector output in input to Graphviz (dot)

epsgraphicssvg

Graphviz (http://www.graphviz.org/) is an exceptionally effective package for drawing graphs of all kinds. Its internal node labelling facility is relatively primitive, but as it allows images to be used as labels, one can produce beautiful graphs using LaTeX to generate appropriate images and then calling Graphviz. I have got this to work by

  1. Using LaTeX to generate a PDF with one image on each page
  2. Using ImageMagick convert to convert the PDF into a series of PNGs
  3. Including the PNGs in input to Graphviz's 'dot' utility.

The results are nice, but it is clear that using a raster format in step 2-3 is visibly degrading the results. I would like to use a vector format instead. Unfortunately, AFAICS, Graphviz does not accept eps and LaTeX does not generate svg. Can anyone see a viable series of tools to get this to work?

(This list of input formats accepted by Graphviz may help: http://www.graphviz.org/doc/info/output.html#d:image_fmts)

NB. I am aware that Graphviz has some limited facility for accepting LaTeX node labels. I am however using pretty complicated drawings.

Edit: here's an example of the kind of thing I'm drawing… http://people.ds.cam.ac.uk/mg262/derivation404.png

Best Answer

One way would be to generate eps from graphviz with arbitrary simple labels and then insert LaTeX typeset labels using psfrag.