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

\Tree [.CP [.TP [.NP [.D the ] [.N woman ] [.CP [.TP [.NP [.N who
] ] [.VP [.V stole ] [.NP [.D my ] [.N necklace ] ] ] ] ] ] [.VP
[.V entered ] ] ] ]

which gives me a nice tree, but the last leaf nodes (e.g. from N to woman) have a line connecting. Can I remove that one?

share|improve this question
    
Please always post code that begins with \documentclass{...} and ends with \end{document}, a so-called minimal working example (MWE). Once you've got this, it's easy to add a picture of the output to the question as well, which makes it more accessible for potential answerers. –  doncherry Oct 3 '12 at 21:07
add comment

1 Answer

up vote 4 down vote accepted

Yes, you can remove this by doing the following:

Add the line

    \tikzset{every tree node/.style={align=center, anchor=north}}

This allows node labels to have line breaks in them.

Then make all your terminal nodes be part of the node label itself:

\documentclass{article}
\usepackage{tikz-qtree}
\tikzset{every tree node/.style={align=center, anchor=north}}
\begin{document}
\Tree [.CP [.TP [.NP [.D\\the ] [.N\\woman ] [.CP [.NP [.N\\who
] ] [.TP [.NP\\t ]  [.VP [.V\\stole ] [.NP [.D\\my ] [.N\\necklace ] ] ] ] ] ] [.VP
[.V\\entered ] ] ] ]
\end{document}

output of code

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.