# Including LaTeX vector output in input to Graphviz (dot)

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

-
If the purpose is to export figures from Graphviz to LaTeX, you probably may need to have a look to the `dot2texi` package that allows to export the image into `pgf`, `tikz` or `pstricks` code. From that point on one could insert labels very easily. –  Claudio Fiandrino Sep 13 '12 at 16:14
No... the purpose is to export labels from LaTeX to Graphviz. The png I linked to above may make it clearer. –  Mohan Sep 14 '12 at 15:22
Isn't it possible to generate `.ps`'s with preview and `dvips` and then feed it to `dot`? –  Andrew Zabavnikov Jul 23 '14 at 15:51

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