LaTeX and graphviz: "no room for a new \write"

The package was obviously never tried by its author for anything but trivia.

To put it right, change

\newcommand{\digraph}[3][scale=1]{ 
  \newwrite\dotfile 
  ...

in the package to

\newwrite\dotfile
\newcommand{\digraph}[3][scale=1]{
  ...

(i.e., move the \newwrite out of the command). Some lines below, remove the \newwrite\dotfile line from the definition of \graph.

FWIW, you're right; there is no way to increase the number of \write streams. and of course, using TikZ is a good alternative, so carry on with that if it suits you.


You could use the morewrites packages:

http://get-software.net/macros/latex/contrib/morewrites/morewrites.pdf

Basically, all you need to do is to add the line

\usepackage{morewrites}

somewhere near the beginning of your document and the "No more room for a new \write" error should disappear.


With pgf/tikZ you could evade this problem.

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}

\begin{document}
  This is a state machine:

  \begin{tikzpicture}[%
    >=stealth,
    node distance=2cm,
    on grid,
    auto
  ]
    \node[state] (A)              {A};
    \node[state] (B) [right of=A] {B};
    \path[->] (A) edge node {0} (B);
  \end{tikzpicture}
\end{document}

The package manual has the details. There is also a specific example gallery.


enter image description here