2

How can a connect two V nodes with an arrow? The nodes to be connected are from differente trees.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{forest}

\begin{document}

\begin{forest} [VP[DP][V’[V,red][DP]]] \end{forest} \quad \begin{forest}[VP [DP ] [ V’[V,red][ DP]] ]\end{forest}

\end{document}

Here is the image

JJSilva
  • 323
  • 2
    Does https://tex.stackexchange.com/questions/393646/how-to-link-different-trees-with-tikz help? – Torbjørn T. Jul 17 '22 at 19:24
  • Look for arrow or edge, see e.g. p. 59 in the manual https://mirror.marwan.ma/ctan/graphics/pgf/contrib/forest/forest-doc.pdf – MS-SPO Jul 17 '22 at 19:26

2 Answers2

2

You can use the tikzmark package or you can combine them into one tree like this

\documentclass[tikz, border=1cm]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{forest}
[, phantom, s sep=2cm
[VP[DP][V’[V, red, alias=a][DP]]]
[VP[DP][V’[V, red, alias=b][DP]]]
]
\draw[-Stealth] (a.south east) to[bend right] (b.south west);
\end{forest}
\end{document}

Two trees with arrow between them

1

One alternative for you:

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[xscale=.5]
\path
(0,0) node (A) {VP} 
+(-1,-1) node (B1) {DP} 
++(1,-1) node (B2) {V'} 
+(1,-1)  node (C1) {DP} 
+(-1,-1) node[red] (C2) {V}
;
\path[xshift=7cm]
(0,0) node (X) {VP} 
+(-1,-1) node (Y1) {DP} 
++(1,-1) node (Y2) {V'} 
+(1,-1)  node (Z1) {DP} 
+(-1,-1) node[red] (Z2) {V}
;
\draw 
(A)--(B1) (A)--(B2) (B2)--(C1) (B2)--(C2)
(X)--(Y1) (X)--(Y2) (Y2)--(Z1) (Y2)--(Z2)
;
\draw[-stealth,red] (C2) to[bend right=15] (Z2);
\end{tikzpicture}
\end{document}
Black Mild
  • 17,569