# No room for a new \dimen when including TikZ [duplicate]

Possible Duplicate:
No room for a new \dimen

I have a fairly large document which uses 30 or so packages. I was going to add some TikZ graphics, so I added the following to my header file:

\usepackage{tikz,pgfplots}

However, this gave me a lot of errors of the type

! No room for a new \dimen .

After looking around, this seems to be related to a limitation of TeX. Is it not possible to use TikZ with many other packages? I am using MikTeX 2.9 and pdflatex.

-

## marked as duplicate by egreg, Paulo Cereda, Roelof Spijker, percusse, JakeApr 13 '12 at 14:52

Write

\usepackage{etex}

just after the \documentclass line (it should be the first loaded package).

-
Excellent. I tried the -enable-etex switch but it didn't help. –  Ben Dec 29 '10 at 4:42
@Ben. The etex package modifies how LaTeX allocates registers to use e-TeX. The command-line switch you added (which is on by default anyway) only makes the extensions available: it does not change how LaTeX actually works. –  Joseph Wright Dec 29 '10 at 7:42
I had the same problem. When I put \usepackage{etex} after \usepackage{pgfplots} the errors remain. However, if I load etex before pgfplots it works fine and no more errors. Cheers! Peter –  user13557 Apr 13 '12 at 12:04
That's most likely because pgfplots loads tikz internally and you need to ensure that the etex package is loaded before tikz is loaded, thus before pgfplots is loaded as well. –  Loop Space Apr 13 '12 at 12:28
This worked also for a LyX (beamer) document. Instruction added first in the Preamble. –  Nikos Alexandris Apr 10 '14 at 14:00