TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 '12 at 19:37
I can live without savetrees. – Reactormonk Dec 10 '12 at 19:53
up vote 4 down vote accepted

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.

share|improve this answer
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 '14 at 16:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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