I would like to be able to draw movement arrows (which can overlap) underneath a linguistic example sentence (not a tree). However, everyone seems to be using gb4e but when I paste the examples into TexShop and compile them the arrows come out a weird angles and the text is messed up..(see screenshots).. Any idea what is going on?
Thanks in advance.
The code:
\documentclass[11pt, dvipdfmx]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\tikzmark[1]{\tikz[remember picture, baseline=(#1.base)] \node[anchor=base,inner sep=0pt, outer sep=0pt] (#1) {#1};}
% This code from http://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 adn 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}
\setlength{\arrowht}{0ex}
}
\usepackage{gb4e}
% The following code modified from
% http://permalink.gmane.org/gmane.comp.tex.linguistics/1036
% This adds some extra space after the first line
\newlength{\arrowht}
\setlength{\arrowht}{0ex}
\newcommand*\cgdepthstrut{{\vrule height 0pt depth \arrowht width 0pt}}
\renewcommand\eachwordone{\cgdepthstrut\rmfamily}
\renewcommand\glt{\vskip -\topsep}
\let\trans=\glt
\newcommand\arrowex{\setlength{\arrowht}{2.5ex}\ex}
\begin{document}
\begin{exe}
\ex\label{scramble-det}
\begin{xlist}
\arrowex
\gll
\ldots dat Jan \tikzmark{een} auto gisteren \tikzmark{t} gekregen heeft.\\
\ldots that John a car yesterday t gotten has \\
\ldots that John a car yesterday.
\arrow{t}{een}
\end{xlist}
\end{exe}
\begin{exe}
\ex\label{scramble-dets}
\begin{xlist}
\ex
\gll
\ldots dat Jan een auto gisteren t gekregen heeft.\\
\ldots that John a car yesterday t gotten has \\
\ldots that John a car yesterday.
\end{xlist}
\end{exe}
\begin{exe}
\ex[]{
\gll
John-wa totetumonaiukurai baka-da. \\
John-Top very stupid-cop \\
`John is very studip.'
}
\ex[]{
\gll
John-wa totetumonaiukurai dousiyoumonai tondemonai sukuigatai baka-da. \\
John-Top very very very very stupid-cop \\
`John is very studip.'
}
\arrowex[]{
\gll
\tikzmark{John}-wa totetumonaiukurai dousiyoumonai tondemonai sukuigatai \tikzmark{t} baka-da. \\
John-Top very very very very stupid-cop \\
`John is very stupid.'
\arrow{t}{John}
}
\end{exe}
\end{document}
dvipdfmxto the document class? And you can't draw an arrow automatically from the second line of a gloss to the first. But this is a duplicate of Long-distance movement arrow in gloss. – Alan Munn Jan 20 '18 at 15:09