4

How do I draw such tree like this

enter image description here

where the some of the edges are double lines using TikZ or any other package?

Here is the code:

\Tree [.root [.a (i want here to have double edge line)b [.b c ] ] [.a [ .b c ] [.b d [.c [.d d ] ]] ] ]

2 Answers2

1

With forest it is easy.

\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\tikzset{my dbl/.style={double,double distance=2pt}}
\begin{forest}
for tree={edge=thick,calign=fixed edge angles}
[a
 [b,edge=my dbl
  [b
   [b
    [c]
   ]
   [c,edge=my dbl]
  ]
  [*
   [c,edge=my dbl]
  ]
 ] 
]
\end{forest}
\end{document}

enter image description here

0

tikz-cd can do the trick

\documentclass{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=0.4cm,row sep=0.4cm]
& & a \arrow[d,equal] & \\
& & b \arrow[rd,dash]\arrow[ld,dash] & \\
& b \arrow[rd,equal]\arrow[ld,dash] & & * \arrow[d,equal] \\
b \arrow[d,dash] & & c & c\\
c & & &
\end{tikzcd}
\end{document}

enter image description here