[Tex/LaTex] How to make gv (DOT) files work under LyX


I'm using LyX. After adding this gv file using Insert->Graphics, LyX automatically generated a perfect preview of the file, as expected.
Automatic preview of GraphViz in LyX
However, when I try to export or get a preview using dvi (Ctrl+D) or pdflatex (Ctrl+R), I get the following LaTeX error:

Package pdftex.def Error: File `1_home_user_Documents_PATH_TO_FOLDER_fsm.png' not found.

and the following LyX error (message box):

No information for converting format files to png. Define a converter in the preferences.

Background info:

  1. After installing GraphViz I did Tools->Reconfigure.
  2. The GraphViz Dot -> PNG converter is defined as dot -Tpng $$i -o $$o.
  3. Converting the gv file manually to png doesn't help (unless of course if I use the png file directly as the graphics…).

Best Answer

Use dot -Tsvg foo.dot > foo.svg to export your graph in vector format, then embed that.