关于这个问题:
我还有一个问题:
是否可以得到四个箭头:两个箭头位于文本下方,两个箭头位于文本上方。到目前为止,两个方向只有两个箭头…… :(
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{gb4e}
\newlength{\arrowht}
\setlength{\arrowht}{-2.5ex}
\newcommand*\exdepthstrut{{\vrule height 0pt depth -\arrowht width 0pt}}
\newcommand\tikzmark[1]{\tikz[remember picture, baseline=(#1.base)] \node[anchor=base,inner sep=0pt, outer sep=0pt] (#1) {#1\exdepthstrut};}
% This code from https://tex.stackexchange.com/q/55068/2693
\tikzset{
ncbar angle/.initial=90,
ncbar/.style={
to path=(\tikztostart)
-- ($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)
-- ($(\tikztotarget)!($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztostart)$)
-- (\tikztotarget)
},
ncbar/.default=0.5cm,
}
% Thanks to Paul Gessler and Percusse for code improvement here
\newcommand{\arrow}[2]{\begin{tikzpicture}[remember picture,overlay]
\draw[->,shorten >=3pt,shorten <=3pt] (#1.base) to [ncbar=\arrowht] (#2.base);
\end{tikzpicture}
}
\begin{document}
\begin{exe}
\ex Example 1
\gll ~\tikzmark{lachend} ~sagte sie \tikzmark{t} das\\
[VF ][LSK][ MF {} {} ]\\
\arrow{t}{lachend}
\ex Example 2
\gll und ~hob sie t ~~auf schrecklich weinend\\
{} [LSK][ MF \tikzmark{t} ][RSK][ \tikzmark{NF} {} ]\\
\arrow{t}{NF}
\end{exe}
\end{document}