4

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}
8

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}

output of code

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

(code omitted)

second output

  • 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

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.