3

How can I keep arrows in the forest environment from overlapping with tree elements? I want the arrows to be like the red one.

\documentclass[a4paper]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[linguistics]{forest}

\begin{document}

(2)\quad Where will the director order the actor to stand? \

\begin{forest} for tree={calign=fixed edge angles, calign primary angle=-70, calign secondary angle=70} [CP [DP$_i$ [where, roof, name=where in]] [C$'$ [C \ will$_j$, name=will in] [TP [DP [the director, roof]] [T$'$ [$t_j$, name=will out] [vP [v \ order, name=order in] [VP [DP$_m$ [the actor, roof]] [V$'$ [$t_k$, name=order out] [TP [PRO$_m$] [T$'$ [T \ to] [VP [V \ stand] [$t_i$, name=where out]]]]]]]]]]] \draw[->] (will out) to[out=-90, in=-90] (will in); \draw[->] (where out) to[out=-90, in=-90] (where in); \draw[->] (order out) to[out=-90, in=-90] (order in); \end{forest}

\end{document}

  • 1
    You can try the looseness option for the arrow and mayby slightly change the in angle – Excelsior Apr 12 '21 at 17:15
  • 1
    I changed one arrow to \draw[->] (will out.south west) to[out=-135, in=-90, looseness=1.5] (will in.south west);, maybe it still looks adequate for you ... – Excelsior Apr 12 '21 at 17:21
  • 1
    This answer may be helpful for you to understand how to add control points to guide the arrow around the subject DP. The example there uses tikz-qtree rather than forest to draw the tree itself, but that doesn't make a difference -- both use normal tikz arrows. https://tex.stackexchange.com/a/251040/42880 – Jason Zentz Apr 12 '21 at 18:55

1 Answers1

3

As suggested in the comments, probably the easiest way would be to play around with the in/out angles and/or the looseness of the arrow, to see which path doesn't cross the DPs and still looks alright to you.

For example:

enter image description here

\documentclass[a4paper]{article}
\usepackage[margin=0.5in]{geometry}
%\usepackage[utf8]{inputenc}
\usepackage[linguistics]{forest}

\begin{document}

(2)\quad Where will the director order the actor to stand? \\

\begin{forest} for tree={calign=fixed edge angles, calign primary angle=-70, calign secondary angle=70}
    [CP [DP$_i$ [where, roof, name=where in]]
    [C$'$   [C \\ will$_j$, name=will in]
    [TP [DP     [the director, roof]]
    [T$'$   [$t_j$, name=will out]
    [vP [v \\ order, name=order in]
    [VP [DP$_m$ [the actor, roof]]
    [V$'$   [$t_k$, name=order out]
    [TP [PRO$_m$]
    [T$'$   [T \\ to]
    [VP [V \\ stand]
    [$t_i$, name=where out]]]]]]]]]]]
    \draw[->] (will out) to[out=-120, in=-120,looseness=1.5] (will in);
    \draw[->] (where out) to[out=-120, in=-90] (where in);
    \draw[->] (order out) to[out=-120, in=-120,looseness=1.5] (order in);
\end{forest}

\end{document}


Unrelated to the question itself:

If you aren't hardcoding (2)\quad just for this MWE but in your document as well, I would recommend switching to a package for numbered examples (and linguistic glosses). My personal favorite is expex, but there are many other options like linguex, gb4e, or covington.

schoekling
  • 3,142