# Dimension too large with tikz-qtree

I want to draw a tree with tikz-qtree, but it bails with Dimension too large.

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{pdflscape}
\usepackage{tikz}
\usepackage{tikz-qtree}

\begin{document}

\begin{landscape}
\Tree [.CP [.TP [.NP [ ] [.N' [ ] [.N Abelard ] ] ] [.T has ] [.V' [.V written ] [.NP [.D a ] [.N volume ] [.PP [.P' [.P of ] [.NP [ ] [.N' [.N poems ] [ ] ] ] ] ] ] [.PP [.P' [.P in [.NP [ ] [.N' [.N Latin ] [ ] ] ] ] ] ] [.PP [.P' [.P for ] [.NP [ ] [.N' [.N Héloïse ] [ ] ] ] ] ] ] ] ]
\end{landscape}

\end{document}

-
Please tell (description of the wanted tree) or show us (image or drawing) what you want to achieve. Only to see your code not compiling is not very helpful for us ... – Kurt Oct 8 '12 at 22:54
@Kurt In this case I think Tass's example is entirely appropriate. Anyone who is familiar with the package can identify the problem with the minimal examples that he has posted. There is no need to have anything else. – Alan Munn Oct 9 '12 at 3:42

As percusse has noted (answer now deleted) the problem is with completely empty nodes. Filling them with a space element such as \, would add an empty terminal node, which would remove the error, but also yields extra vertical branches in the tree, which is not really what you probably want. A better solution is to add empty node labels instead of using spaces as terminal nodes:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{pdflscape}
\usepackage{tikz}
\usepackage{tikz-qtree}

\begin{document}

\begin{landscape}
\Tree [.CP [.TP
[.NP [.{} ] [.N' [.N Abelard ] ] ]
[.T has ]
[.V' [.V written ]
[.NP [.D a ]
[.N volume ]
[.PP [.P' [.P of ]
[.NP [.{} ]
[.N' [.N poems ] [.{} ] ] ] ] ] ]
[.PP [.P' [.P in [.NP [.{} ]
[.N' [.N Latin ]
[.{} ] ] ] ] ] ]
[.PP [.P' [.P for ]
[.NP [.{} ]
[.N' [.N Heloise ]
[.{} ] ] ] ] ] ] ] ]
\end{landscape}

\end{document}


Personally, as a linguist, I would just leave the empty nodes out of the tree altogether:

(code omitted)

-
It was good enough, but yours @AlanMunn looks clearly better. Well, we were instructed to draw empty branches in this one exercise. – Reactormonk Oct 9 '12 at 16:42