I'm using TeXShop on Mac OS X (based on LaTeX) in conjunction with the graphvizzz package in order to draw inline directed graphs in my documents (with the use of write18 and the dot command). Apparently each graph uses a \write command, so I got up to about a dozen inline graphs in a single document and ran out of \write slots. When I try to build the document, I now get the following error:

? ! No room for a new \write .

I've done some reading about this problem, and there's no immediately apparent way to increase the number of \writes available to me. Is there another way I can continue to use this package without requiring a \write for each graph?

For reference, a sample document looks something like this:



This is a state machine:
   margin = "0 0 0 0";
   rankdir = "LR";
   node [ shape = "circle" ] A B;
   A -> B [ label = "0" ];


4 Answers 4


With pgf/tikZ you could evade this problem.


  This is a state machine:

    node distance=2cm,
    on grid,
    \node[state] (A)              {A};
    \node[state] (B) [right of=A] {B};
    \path[->] (A) edge node {0} (B);

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

enter image description here

  • This looks like a much better solution than what I'm currently using - I'll check it out. Thanks!
    – Tim
    Dec 6, 2010 at 22:01

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

To put it right, change


in the package to


(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.

  • I was thinking of suggesting (reminding?) either you or the OP to make sure this gets reported to the package author, but I see that someone has already reported it as code.google.com/p/graphvizzz/issues/detail?id=1, with a link straight here for the fix. Good job, whoever it was.
    – SamB
    Dec 9, 2010 at 2:11
  • I actually handled it - thanks anon for suggesting the change, or I wouldn't have thought to report it as an issue in the first place.
    – Tim
    Dec 10, 2010 at 2:27
  • Thanks, this got me to inspect the sty file, noting that there is now an option that you can pass to usepackage: singlefile which did the trick for me.
    – marcolz
    Feb 4, 2022 at 13:20

You could use the morewrites packages:


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


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

  • 1
    While this can be a useful tip in general, the "real" solution to the particular problem is to correct a the clearly faulty package, taking out the \newwrite\dotfile declarations from the definitions of \digraph and \graph and issuing it once and for all at the start. This will cooperate well with morewrites, of course. Unfortunately, the bug hasn't been corrected in almost 18 months.
    – egreg
    May 31, 2012 at 13:22

LaTeX has a limit of 16 open files, and many packages open them.

There are 3 solutions for this error:

  • Use LuaLaTeX, and the limit will be the limit in the operating systems (never tried)
  • Use the packages morewrites (used it for a while but later hit in a bug)
  • Use the package scrwfile from KOMA-Script (my current, and smoothly running, choice)

morewrites and scrwfile have different approaches to solve this problem, but both change the LaTeX kernel somehow. Deep Magic.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .