enter image description here

Can somebody help me with this code? I tried to write it. Thank you

        el/.style={edge label={node[auto,pos=0.6]{$#1$}}},
        el'/.style={edge label={node[auto,pos=0.6,swap]{$#1$}}},
        for tree={math content,s sep+=4em,l sep+=1.5em,edge={semithick,-latex}}
        [(D,R),el= (a,b)

2 Answers 2


You could do this with tikz-cd instead of forest.

enter image description here


\tikzcdset{arrow style=tikz, diagrams={>=latex}}


\[\begin{tikzcd}[row sep=1cm, column sep=0cm]
 & (5,5,2) & & (4,4,1)\\
 & & \{a,b\}\arrow[ul,"{(U,L)}"]\arrow[ur,"{(U,R)}"']\arrow[dl,"{(D,L)}"']\arrow[dr,"{(D,R)}"]\\
 & P\arrow[dl,"N"']\arrow[dr,"P"] & & (5,5,2)\\
(4,4,1) & & (6,0,0)

  • That's a nice library to use. Thanks a lot!
    – Henam
    Commented May 19, 2020 at 5:35
  • 1
    @Henam, you are very welcome. It may seem strange, but at TeX.SX we typically don't use comments for giving thanks. Instead, simply vote up answers that you find helpful.
    – Sandy G
    Commented May 19, 2020 at 13:31
  • 1
    A good answer cannot have a zero score.
    – Sebastiano
    Commented May 19, 2020 at 20:39

If you need to draw many game trees, another option is to use the istgame package:

enter image description here




\tikzset{oval node/.style={ellipse node,draw=none}}


You must log in to answer this question.

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