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 seen this nice little example tree drawn with LaTeX, afaik not tikz. Can I draw similar arrows with tikz-qtree by specifying start and end point only?

example tree

share|improve this question
add comment

1 Answer 1

up vote 10 down vote accepted

This isn't too hard to do with tikz-qtree. In order to get the movement arrow from T to C to go under the VP, I made the object DP a node and used that as a reference point to create an intermediate node that the line passes through. Thanks very much to both Peter Grill and percusse for suggesting elegant ways to avoid the VP structure. The final solution is due to percusse, who also provided the nifty code to have the one arrow jump over the other.

\documentclass{article}
\usepackage{tikz-qtree, tikz-qtree-compat}
\tikzset{every tree node/.style={align=center, anchor=north}}
\usetikzlibrary{positioning}
\usepackage{fixltx2e}
\newcommand*\sub{\textsubscript}
\begin{document}
\begin{tikzpicture}
\Tree [.CP  
        [.\node (DP) {DP};  \edge[roof];  {Die Kinder} ]
        [.C\1 
          [.\node (C) {C\\haben}; ] 
          [.TP [.\node (DPt1) {DP\\t\sub{i}}; ] 
            [.T\1 
              [.VP 
                [.VP [.\node (DPt2) {DP\\t\sub{i}}; ] 
                  [.V\1  
                    [.\node (Obj) {DP}; \edge[roof]; {diesen Film} ]  
                    [.V\\gesehen ] ] ] 
                [.\node (Aux) {V\\t\sub{j}}; ] ] 
            [.\node (T) {T\\t\sub{j}}; ]]]]]
\node (DPn) [below=1cm of DP] {};
\draw [->] (DPt1) -|  (DPn);
\draw [->] (DPt2) -| (DPt1);
\draw [->] (Aux.south) -| (T);
\draw [->] (T.east) |- ([yshift=-1.5cm] Obj.south) 
           -| ([yshift=-1.5mm]C |- DPt1) arc (-90:90:1.5mm) -- (C);
\end{tikzpicture}
\end{document}

output of code

share|improve this answer
    
Not sure if this is important in the question, but -latex would produce _similar arrows_` –  Peter Grill Nov 30 '12 at 23:08
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.