1

Can anybody recognize the package that is used to produce these cool arrows? This particular one is taken from https://ling.auf.net/lingbuzz/004081 but I've seen it many times in syntax papers, with lots of variations. No idea what it is other than some other features of the papers I've seen it in seem to be working under XeLaTeX (judging by other packages that don't easily work under LaTeX).

enter image description here

oliver
  • 339

2 Answers2

6

Many years ago I promised in a comment to turn an answer to a similar question into a package.

Your question has spurred me on to actually make good on that promise ten years later. The movement-arrows package is now available on CTAN, and if you have a current year TeXLive or MikTeX it can be installed as a regular update to your distribution. The code in the package departs substantially from the code in the answer, thanks to the tikz-extra suite of TikZ libraries.

The basic idea remains the same: you markup words as nodes using a \mkword macro and then use an \mvarrow command to add the arrows. The \mkword macro uses word as the node name if provided with a single argument. If the word argument is a phrase or contains other markup (subscripts, formatting, etc.) you must provide an explicit node name using the optional argument.

The \mvarrow macro takes two nodes and connects them. The optional argument allows you to add the circled label using circ=<label>. circ is a TikZ style, and so other types of labels can be created as needed.

\mkword[<name>]{<word>}
\mvarrow[circ=<label>]{<from-name>}{<to-name} % under arrow
\mvarrow*[circ=<label>]{<from-name>}{<to-name} % over arrow

Here's the example from Nevins and Weisser (a topic close to my heart!) For compatibility with other packages, I've not used the \automath function of gb4e which allows for _ and ^ in regular text but instead used a \sb macro.

\documentclass[12pt]{article}
\usepackage{movement-arrows}
\usepackage{gb4e}
\let\sb\textsubscript
\begin{document}
\begin{exe}
\ex This is an example.
\end{exe}
\begin{exe}
\sn
\ex{[ [\sb{ConjP} [ \mkword[NP1]{NP\sb{1}} [\sb{Conj'} in \mkword[NP2]{NP\sb{2}} ] ] \textsc{aux}  \mkword{V} \dots}
\mvarrow*[circ=1]{V}{NP1}
\mvarrow[red,circ=2]{V}{NP2}
\end{exe}

\end{document}

output of gb4e code

For arrows with glossed examples, the gloss line needs to be preceded by the \glossarrow command to make the appropriate amount of space for the arrow. Arrows above the words can use an \arrowstrut command to add more vertical space.

Here's the same example using linguex. I've created a version of the \sn macro that adds some vertical space before the example using the over-arrow. This stops the arrow from encroaching on the previous example.

\documentclass[12pt]{article}
\usepackage{movement-arrows}
\usepackage{linguex}
\let\sb\textsubscript
\begin{document}
\ex. This is an example.

\ex. \arrowstrut {[ [\sb{ConjP} [ \mkword[NP1]{NP\sb{1}} [\sb{Conj'} in \mkword[NP2]{NP\sb{2}} ] ] \textsc{aux} \mkword{V} \dots} \arrow*[circ=1]{V}{NP1} \arrow[red,circ=2]{V}{NP2}

\end{document}

output of linguex code

Alan Munn
  • 218,180
  • Thanks -- and congratulations! However, I can't even generate the source file from CTAN (half a day devoted to all updates, TexLive, downloads, installations, and nothing). Could you come up with a minimal working example with linguex? – oliver May 24 '23 at 19:53
  • Do you have an up-to-date TeX distribution? What OS are you using? This shouldn't be very difficult, and you shouldn't need to do this via CTAN at all. – Alan Munn May 24 '23 at 20:03
  • 1
    @oliver I've added a linguex example and removed some specifically gb4e code from the tree itself. Although unless you've got lots of documents already using linguex I would recommend using gb4e instead. – Alan Munn May 24 '23 at 20:21
  • I'm using MacOS Ventura and while I do see movement-arrows listed in Tex Utility packages tab as "Not installed", Tex Live Utility needs to be updated to instal it. But it keeps failing to update... Installing a new MacTex didn't help. – oliver May 24 '23 at 20:36
  • @oliver If you have a little time we could try to solve this here – Alan Munn May 24 '23 at 20:46
  • 1
    @oliver Are you using the most recent version. I pushed a bug fix to CTAN a few days ago. (I'll also update this answer, which doesn't match the current version any more.) – Alan Munn Jun 06 '23 at 23:56
  • 1
    @oliver You can freely delete comments! – Alan Munn Jun 07 '23 at 00:32
2

Maybe this approach could be useful

\documentclass{article}

\usepackage{tikz-cd}

\begin{document} [ \begin{tikzcd}[column sep=tiny] & {} & {}\ A & B\ar[u, phantom, ""{coordinate, name=b}] & C\ar[d, phantom, ""{coordinate, name=a}] & D \ar[ll,"1"{pos=0.75,description,shape=circle,draw=white,double=black,double distance=0.4pt,inner sep=1pt},to path={ -- (\tikztostart.north) |- (b) \tikztonodes -| (\tikztotarget.north) }] \ar[l,"2"{pos=0.75,description,shape=circle,draw=white,double=black,double distance=0.4pt,inner sep=1pt},to path={ -- (\tikztostart.south) |- (a) \tikztonodes -| (\tikztotarget.south) }] \ && {} \end{tikzcd} ] \end{document}

enter image description here

Luis Turcio
  • 2,757
  • Thanks, but while it does look like tikz, it would seem overly too complex to serve merely as additions to sometimes complex bracketed structures in linguistics -- and yet I do see it used fairly regularly. I was thinking it may be something as easy to write as this https://tex.stackexchange.com/questions/422681/movement-arrows-in-linguex-in-xelatex but available under XeLaTeX (which the one in the link seems not to be). – oliver May 21 '23 at 14:18