I want to connect two forest trees with an arrow, in a similar way it is discussed here for plain tikz trees. However, it seems to be impossible to add options to the forest environment in a similar fashion. Simply referencing the nodes will only place the arrow to the right of the right tree. (To avoid confusions: I don't speak about the $\Rightarrow_G$
in the first forest environment, but the bended one, that should connect two specific nodes.)
\documentclass{beamer}
\usepackage{tikz}
\newcommand{\false}{\mathbf{f}}
\usetikzlibrary{calc, positioning}
\usetikzlibrary{arrows}
\usepackage{forest}
\setbeamercovered{transparent}
\begin{document}
\begin{frame}{}
% Tree 1
\begin{forest}
[$\sigma$, calign=last
[$a$]
[{\langle \sigma, \{1,2\},\false \rangle}%
, math content, calign=first, baseline, draw=blue, ellipse, name = replaceNode
[$\sigma_*$]
[$a$]
]
]
\node at (current bounding box.east)
[anchor=west]
{$\Rightarrow_G$};
\end{forest}
%
% Tree 2
\begin{forest}
[$\sigma$, calign=last
[$a$]
[$\sigma$, calign=last
[$b$]
[{\langle \sigma, \{1,2\},\false \rangle}%
, math content, calign=first, baseline, name = t1
[$\sigma$, calign=first
[$\sigma_*$]
[$a$]
]
[$b$]
]
]
]
\end{forest}
%
% This arrow should connect two nodes of both trees.
\begin{tikzpicture}
\draw[->, black, dashed, bend angle=45, bend left] (replaceNode) to (t1);
\end{tikzpicture}
\end{frame}
\end{document}
There seems to be the workaround of putting both trees in the same forest environment with a phantom parent node. However, I would appreciate an overlay solution for better modularity of my graphics, especially if more than two trees are involved.
remember picture
option by for example\forestset{begin draw/.code={\begin{tikzpicture}[remember picture]}}
, but this ruins the rendering.tikzmark
work withforest
?