1

How can I ensure that the arrow from $t_2$ curves below "of"? How can I use \qroof{some company}.DP and yet still have the arrow pointing to it?

\documentclass[12pt,a4paper]{article}   
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ulem}

\begin{document}
\begin{tikzpicture}
\Tree
[.S 
  [.DP [.D Every ] 
    [.NP [.DP$_1$ \node (ne) {PRO}; ]  
        [.NP $\lambda_1$ 
            [.NP \node (ue) {some company}; 
                [.S 
                    [.$\lambda_1$     ] 
                    [.NP    [.\node [circle,draw] (me) {t$_{1}$} ;  ] 
                            [.N$’$ [.N representative ] [.PP [.P of ] 
                                            [. \node [circle,draw] (le) {t$_{2}$} ;   ]
                                            ]
                            ]
                    ]
                ]
            ]
        ]
    ]
  ]
  [.VP [.V saw ] [. \qroof{a sample}.DP ]]
]
\draw[semithick, dashed, ->] (le)..controls +(south west:6) and +(south:6) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:3) and +(south:3) .. (ne);

\end{tikzpicture}

\begin{tikzpicture}
\Tree [.VP John [.V$’$ [.V loves ] \qroof{the man}.DP ]]
\end{tikzpicture}
\end{document}
  • Changing the anchor (where the arrow from $t_2$ comes from) can fix the colliding line. Something like \draw[semithick, dashed, ->] (le)..controls +(south:5) and +(south:6) .. (ue); should work. I don't quite understand the second part of the question, could you explain what you mean? – Christopher Jul 28 '15 at 10:10
1

The collision happens because the of node is along the path between the t2 node and the control point you specify with south west:6. (See my answer to your question Drawing node arrows for more information about how these control points work.)

enter image description here

You need to move the first control point so that the of node is out of the way of this path. It's pretty easy to do this by changing the south west to south, but I would also recommend shortening the distance to get a better looking arrow. And as I mentioned in Drawing node arrows, you can get finer control over the position of control points if you use the xy-coordinate system rather than the compass point system.

To label a roof node so that you can refer to it (e.g., as the endpoint of an arrow), use the following syntax: [.DP \edge[roof]; \node (ue) {some company}; ]. (See Alan Munn's answer to More efficient way to draw movement arrow to roof in tikz-qtree.) This actually means that (ue) is the node under the roof. It is also possible to add a tikz label to the roof's syntactic label (DP) (see Alan Munn's answer to adding a node to a qroof in tikz-qtree), but it's harder in most cases to get the arrows to look nice that way.

enter image description here

\documentclass[12pt,a4paper]{article}   
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ulem}

\usetikzlibrary{decorations.pathreplacing,shapes.misc}
\tikzset{
    show control points/.style={
        decoration={show path construction, curveto code={
                \draw [blue, dashed]
                    (\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta)
                    node [at end, cross out, draw, solid, red, inner sep=2pt]{};
                \draw [blue, dashed]
                    (\tikzinputsegmentsupportb) -- (\tikzinputsegmentlast)
                    node [at start, cross out, draw, solid, red, inner sep=2pt]{};
            }
        },
        postaction=decorate
    },
}

\begin{document}
\begin{tikzpicture}
\Tree
[.S 
  [.DP [.D Every ] 
    [.NP [.DP_1 \node (ne) {PRO}; ]  
        [.NP $\lambda_1$ 
            [.NP
                [.DP \edge[roof]; \node (ue) {some company}; ]
                [.S 
                    [.$\lambda_1$     ] 
                    [.NP    [.\node [circle,draw] (me) {t$_{1}$} ;  ] 
                            [.N$’$ [.N representative ] [.PP [.P of ] 
                                            [. \node [circle,draw] (le) {t$_{2}$} ;   ]
                                            ]
                            ]
                    ]
                ]
            ]
        ]
    ]
  ]
  [.VP [.V saw ] [. \qroof{a sample}.DP ]]
]
\draw[semithick, dashed, ->, show control points] (le)..controls +(-0,-3) and +(0,-4) .. (ue); % equivalent to +(south:3) and +(south:4)
\draw[semithick, dashed, ->] (me)..controls +(south west:3) and +(south:3) .. (ne);

\end{tikzpicture}
\end{document}
1

Sorting out the colliding arrow from $t_2$ to \node (ue) {some company}; can be achieved by altering the anchor from which the arrow comes from. From +(south west:6) to +(south:3). A larger number can be used here if desired.

This answer shows that \qroof is not appropriate here and \edge[roof]; can be used instead. I wasn't entirely sure how you wanted the roof to look but here's what I came up with.

\documentclass[12pt,a4paper]{article}   
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ulem}

\begin{document}
\begin{tikzpicture}
\Tree
[.S 
  [.DP [.D Every ] 
    [.NP [.DP_1 \node (ne) {PRO}; ]  
        [.NP $\lambda_1$ 
            [.NP [\edge[roof]; \node (ue) {some company};]
                [.S 
                    [.$\lambda_1$     ] 
                    [.NP    [.\node [circle,draw] (me) {t$_{1}$} ;  ] 
                            [.N$’$ [.N representative ] [.PP [.P of ] 
                                            [. \node [circle,draw] (le) {t$_{2}$} ;   ]
                                            ]
                            ]
                    ]
                ]
            ]
        ]
    ]
  ]
  [.VP [.V saw ] [. \qroof{a sample}.DP ]]
]
\draw[semithick, dashed, ->] (le)..controls +(south:5) and +(south:6) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:3) and +(south:3) .. (ne);

\end{tikzpicture}

\begin{tikzpicture}
\Tree [.VP John [.V$’$ [.V loves ] \qroof{the man}.DP ]]
\end{tikzpicture}

\pagebreak

\begin{tikzpicture}
\Tree [ .TP I [ .T\1 T\\{[past]} [ .\node(vp){vP}; { } [ .v\1 v\\saw 
      [ .VP { } [ .V\1 V\\(saw) [.\node(nP){nP}; \edge[roof]; {a man} ] ] ] ] ] ] ]
\end{tikzpicture}

\end{document}

Which gives,

enter image description here

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.