Tikz-qtree:在屋顶下用不同的单词绘制箭头

Tikz-qtree:在屋顶下用不同的单词绘制箭头

我想从屋顶下的不同单词画出箭头。在我的例子中,“Mary saw who”在屋顶下,我希望从“Mary”画出一个箭头,从“who”画出另一个箭头,指向树中更上层的“Mary”和“who”。我无法将单独的单词标记为屋顶下的节点,只能将整个短语标记为节点(如我的例子所示)。当我这样做时,我可以通过更改值或坐标来绘制一个箭头,以便操纵它从“who”和“saw”指向[xshift],但出于某种原因,我无法让它从“Mary”指向。

\documentclass{report}  
\usepackage{tikz-qtree}  
\usepackage{tikz-qtree-compat}  

\begin{document}

\begin{tikzpicture}  
\tikzset{every tree node/.style={align=center,anchor=north}}  
\Tree   
[.CP [.specCP \node(wh){$[$Q, $\phi$^{\textsc{epp}} $]$ \\ who}; ]    
[.C\1 [.C  ]  
[.TP [.DP \node(DP2){Mary}; ]  
[.T\1 [.T saw ]  
[.$v$P [.DP \node(wh2){who}; ]  
[.$v$\1 \edge[roof];  \node(x){Mary saw who}; ]  
  ] ] ] ] ] ]   
 \draw [->] ([xshift=0.1em]x.south) to[out=-90,in=-90,looseness=2] (DP2.south);  
 \draw [->] (x.south)++(1,0) to[out=-90,in=-90,looseness=2] (wh2.south);  

\end{tikzpicture}

\end{document}

答案1

您可以x.south使用x.south westx.south east来更轻松地定位箭头的起点。经过一些测试,我得到了:

\documentclass{report}  
\usepackage{tikz-qtree}  
\usepackage{tikz-qtree-compat}  

\begin{document}

\begin{tikzpicture}  
\tikzset{every tree node/.style={align=center,anchor=north}}  
\Tree   
[.CP [.specCP \node(wh){$[$Q, $\phi$^{\textsc{epp}} $]$ \\ who}; ]    
[.C\1 [.C  ]  
[.TP [.DP \node(DP2){Mary}; ]  
[.T\1 [.T saw ]  
[.$v$P [.DP \node(wh2){who}; ]  
[.$v$\1 \edge[roof];  \node(x){Mary saw who}; ]  
  ] ] ] ] ] ]   
 \draw [->] ([xshift=1.75em]x.south west) to[out=-90,in=-90,looseness=2] (DP2.south);  
 \draw [->]  ([xshift=-1em]x.south east) to[out=-90,in=-90,looseness=2] (wh2.south);  

\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容