8

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

11

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

  • Not sure if this is important in the question, but -latex would produce _similar arrows_` – Peter Grill Nov 30 '12 at 23:08

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.