I've got a snippet of tikz-qtree which causes

** ERROR ** DVI stack exceeded limit.

when compiling with xelatex, but works fine with pdflatex. But I need xelatex because I've got a lot of unicode in the document.

There's the code:

\usepackage{tikz-qtree, tikz-qtree-compat}
\tikzset{every tree node/.style={align=center, anchor=north}}

\tikzset{every tree node/.style={align=center, anchor=north}}
\Tree [.CP [.C' [.C\\ø ] [.TP [.T' [.T\\ed ] [.VP [.DP \edge[roof ];\\I ] [.V' [.V\\ask ] [.CP [.C' [.C ø ] [.TP [.T' [.T\\ed ] [.VP [.DP \edge[roof ];\\John ] [.V' [.V\\believe ] [.CP [.C' [.C ø ] [.TP [.T' [.T\\ed ] [.VP [.DP \edge[roof ];\\Mary ] [.V' [.V' [.V\\lie ] ] [.PP \edge[roof ];\\why ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]

And to download: http://sprunge.us/OaIO

  • 1
    Not a solution, but could you use LuaTeX? Your document compiles fine with it (although it complains about microtype, which I assume is loaded by savetrees.)
    – Alan Munn
    Dec 10, 2012 at 19:37
  • I can live without savetrees. Dec 10, 2012 at 19:53

1 Answer 1


It is an error message from xdvipdfmx. The two stages can be called by:

xelatex -no-pdf test
xdvipdfmx test.xdv

The latter shows a more verbose warning:

** WARNING ** DVI need stack depth of 320,
** ERROR ** Capacity exceeded.

Looking at the sources dvi.c:

#define DVI_STACK_DEPTH_MAX  256u
if (dvi_info.stackdepth > DVI_STACK_DEPTH_MAX) {
  WARN("DVI need stack depth of %d,", dvi_info.stackdepth);
  ERROR("Capacity exceeded.");
static struct   dvi_registers dvi_state;
static struct   dvi_registers dvi_stack[DVI_STACK_DEPTH_MAX];
static unsigned dvi_stack_depth = 0 ;  

That means, the size is hard-coded and cannot be changed at runtime. Recompilation of XeTeX would be needed.

Alternatively generate the image as standalone document (pdfTeX, …) and embed it into your XeTeX document as PDF file.

  • The limitation is also with latex (and DVI output): there's no error, but dvitype says 11020: push DVItype capacity exceeded (stack size=100)! and Bad DVI file: page ended unexpectedly!
    – egreg
    Dec 9, 2014 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.