如何在 tikz-qtree 中标记箭头?

如何在 tikz-qtree 中标记箭头?

我如何用“1”,“2”和“3”标记下面的箭头?

\documentclass[a4paper,12pt]{article}
\usepackage{tikz, tikz-qtree}
\begin{document}
\begin{tikzpicture}

\begin{tikzpicture}
\tikzset{every tree node/.style={align=center,anchor=north}}
\Tree [.TP [.DP$_i$ \edge[roof]; \node(subj){She\\$[${\sc nom}$]$}; ]
[.T$’$ [.T \node(aux){was$_j$ \\$[${\sc epp}$]$\\$[${\sc nom}$]$}; ]
[.VP [.V$’$ [.V \node(aux-t){$t_j$}; \node(tense-t){$t_k$}; ]
[.VP \node(subj-t){$t_i$}; [.V$’$ [.V \node(tense){hide-ing$_k$\\$[${\sc acc}$]$}; ]
[.DP$_l$ \edge[roof]; \node(obj){him\\$[${\sc acc}$]$}; ]]]]]]]
\draw[semithick,->] (subj-t)..controls +(south west:2) and +(south west:4)..(subj);
\draw[semithick,->] (aux-t)..controls +(south west:1) and +(south west:2)..(aux);
\draw[semithick,->] (tense-t)..controls +(south:4) and +(south west:1)..(tense);
\end{tikzpicture}

\end{document}

答案1

node[pos=xx, above]{<number>}在绘制结束时使用。pos=0表示起点,pos=1表示终点。 除 外above,还有left, right, belowabove right... 变体可用。

在此处输入图片描述

\documentclass[a4paper,12pt]{article}
\usepackage{tikz, tikz-qtree}
\begin{document}
\begin{tikzpicture}

\tikzset{every tree node/.style={align=center,anchor=north}}
\Tree [.TP [.DP$_i$ \edge[roof]; \node(subj){She\\$[${\sc nom}$]$}; ]
[.T$’$ [.T \node(aux){was$_j$ \\$[${\sc epp}$]$\\$[${\sc nom}$]$}; ]
[.VP [.V$’$ [.V \node(aux-t){$t_j$}; \node(tense-t){$t_k$}; ]
[.VP \node(subj-t){$t_i$}; [.V$’$ [.V \node(tense){hide-ing$_k$\\$[${\sc acc}$]$}; ]
[.DP$_l$ \edge[roof]; \node(obj){him\\$[${\sc acc}$]$}; ]]]]]]]
\draw[semithick,->] (subj-t)..controls +(south west:2) and +(south west:4)..(subj)node[pos=0.5,above]{1};
\draw[semithick,->] (aux-t)..controls +(south west:1) and +(south west:2)..(aux)node[pos=0.5,above]{2};
\draw[semithick,->] (tense-t)..controls +(south:4) and +(south west:1)..(tense)node[pos=0.5,above]{3};
\end{tikzpicture}

\end{document}

相关内容