1

How do i add the dash line between two tree as in image below,

enter image description here

\begin{center}
\begin{tabular}{p{4cm}p{4cm}}
\tikzset{my dbl/.style={double,double distance=2pt}}
\centering
\begin{forest}
for tree={edge=thick,calign=fixed edge angles}
[a
[b
 [b,edge=my dbl] 
 [$\ast$
 [d]
 ]
 ]
]
   %[\subnode{marke}{e},draw,dashed]
\end{forest} &
\tikzset{my dbl/.style={double,double distance=2pt}}
\centering
\begin{forest}
for tree={edge=thick,calign=fixed edge angles}
[\subnode{markh}{a},name=a,tikz={\node [fit=() (!1)]}
 [b,edge=my dbl
 [d]
 ]
 [$\ast$
 [d,edge=my dbl]
 ]
]
\end{forest}

\end{tabular}
\begin{tikzpicture}[overlay,remember picture]
\draw[green](marke.east)--(markh.west);
%\draw [-stealth](a) to[bend right] (b.west);
\end{tikzpicture}
\end{center}

This is my current code so far. Nothing is working.

1
  • tikzmark library might help
    – user185960
    Apr 18, 2019 at 13:57

1 Answer 1

1

As explained in this answer, you can use \subnodes, which are anyway already present (but commented out) in your code.

\documentclass{article}
\usepackage[edges]{forest}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{center}
\begin{tabular}{p{4cm}p{4cm}}
\tikzset{my dbl/.style={double,double distance=2pt}}
\centering
\begin{forest}
for tree={edge=thick,calign=fixed edge angles}
[\subnode{marka1}{a}
[b
 [b,edge=my dbl] 
 [$\ast$
 [d]
 ]
 ]
]
\end{forest} &
\tikzset{my dbl/.style={double,double distance=2pt}}
\centering
\begin{forest}
for tree={edge=thick,calign=fixed edge angles}
[\subnode{marka2}{a}
 [b,edge=my dbl
 [d]
 ]
 [$\ast$
 [d,edge=my dbl]
 ]
]
\end{forest}
\end{tabular}
\end{center}
\begin{tikzpicture}[overlay,remember picture]
\draw[dashed,-latex] (marka2) to[bend right] (marka1);
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .