Skip to content


Subversion checkout URL

You can clone with
Download ZIP
graphviz.sty - A library for using GraphViz dot files in LaTeX
Branch: master

Merge pull request #1 from bout-de-rim/master

Have done a light clean up and improved error messages
latest commit 9ef36d626d
@mprentice authored
Failed to load latest commit information. Added installation info to README
graphviz.sty Improved error messages

graphviz.sty - A LaTeX library for GraphViz dot

graphviz.sty lets you include GraphViz dot files directly in your LaTeX source.

graphviz.sty is currently only compatible with pdflatex.


You must have the GraphViz dot program in your path.


Copy graphviz.sty to your texmf directory.

On Mac OS X with the MacTeX distribution:

  1. Make folder ~/Library/texmf/tex/latex if it doesn't already exist.
  2. Drag and drop graphviz.sty to that folder.

Or for the Terminally ill:

$ mkdir -p ~/Library/texmf/tex/latex
$ cp graphviz.sty ~/Library/texmf/tex/latex


Add the following lines to your preamble:


To include GraphViz dot syntax directly in your LaTeX source:

\digraph[scale=0.5]{MyGraph}{rankdir=LR; a->b; b->c}

Parameters to \digraph:

  1. parameters for \includegraphics (optional; default value is "scale=1")
  2. name of the digraph
  3. body of the digraph

To include an external GraphViz dot file named


Parameters to \includedot:

  1. parameters for \includegraphics (optional; default value is "scale=1")
  2. name of the dot file (w/out file extension, which must be ".dot")

You must use the -shell-escape option to pdflatex:

$ pdflatex -shell-escape mydoc.tex

Using regular LaTeX

To modify this command for regular latex, replace all .pdf with .ps, and the command becomes simply:

dot -Tps

Other projects

Graphvizzz on Google Code includes support for graph as well as digraph.


graphviz.sty is based on graphviz.tex by Derek Rayside (2003).


graphviz.sty by Mark Aufflick



Modified by Mike Prentice to use PDF output directly from dot.

Added includedot command.

Something went wrong with that request. Please try again.