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 ] ]] ] ]
4
  • I looked up tex.stackexchange.com/questions/224798/… this example but its too complicated for my simple tree. Apr 17, 2019 at 13:57
  • I planned to only use \Tree to build the tree but I am not sure where i should add the function to have double edge line. Apr 17, 2019 at 14:00
  • Add the code without the double line so that we can have a look and add it
    – user156344
    Apr 17, 2019 at 14:02
  • 1
    I have added @JouleV. Apr 17, 2019 at 14:08

2 Answers 2

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

1
  • 1
    This is exactly what I wanted. Thank you :) Apr 17, 2019 at 14:34
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

1
  • Thank you @JouleV . Apr 17, 2019 at 14:33

You must log in to answer this question.

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