Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

\documentclass[11pt]{article}
\usepackage{savetrees}
\usepackage{tikz-qtree, tikz-qtree-compat}
\tikzset{every tree node/.style={align=center, anchor=north}}
\usetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}
\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 ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]
\end{tikzpicture}
\end{document}

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

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

1 Answer

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,
** WARNING ** but DVI_STACK_DEPTH_MAX is 256.
** 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);
  WARN("but DVI_STACK_DEPTH_MAX is %d.", DVI_STACK_DEPTH_MAX);
  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
add comment

Your Answer

 
discard

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.