![森林中带有文字的箭头?](https://linux22.com/image/307055/%E6%A3%AE%E6%9E%97%E4%B8%AD%E5%B8%A6%E6%9C%89%E6%96%87%E5%AD%97%E7%9A%84%E7%AE%AD%E5%A4%B4%EF%BC%9F.png)
\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}