森林中带有文字的箭头?

森林中带有文字的箭头?
\documentclass{article}
\usepackage[margin=.8in]{geometry}
\usepackage{forest} %main + for elongation of two branches of a node
\usepackage{tikz-cd}

\begin{document}
\begin{forest} baseline, for tree={parent anchor=south, child anchor=north, align=center, base=top, l sep+=0em, s sep+=4em}
        [VP
        [DP, [the train, triangle, name=arg1]]
        [V$'$
        [V [arrive, circle, draw, name=V]]]]
\draw[->] (V) to[out=south west, in=south] (arg1);
\end{forest}

\end{document}

你好。有没有什么办法可以像附图中那样在箭头上添加文字?

任何帮助都将不胜感激。谢谢。

在此处输入图片描述

答案1

您只需向已绘制的箭头添加一个节点即可:

% arara: pdflatex

\documentclass{article}
\usepackage[margin=.8in]{geometry}
\usepackage{forest}

\begin{document}
\begin{forest} baseline, for tree={parent anchor=south, child anchor=north, align=center, base=top, l sep+=0em, s sep+=4em}
    [VP
    [DP, [the train, triangle, name=arg1]]
    [V$'$
    [V [arrive, circle, draw, name=V]]]]
    \draw[->] (V) to[out=south west, in=south] node[fill=white,pos=.6]{THEME} (arg1); % leave fill=white away in order to get your image. pos=. is optional. Default would be .5
\end{forest}    
\end{document}

在此处输入图片描述

相关内容