Hey, I'm new to Stack Exchange and Latex. Can anyone help me with how to make this diagram in Latex? Can anyone help me with the code? Thank you

  • 5
    Welcome! There is the istgame package specifically for game trees. In general, trees can be created conveniently with the forest package.
    – user194703
    May 17 '20 at 6:58
  • Can you give some link or anything?
    – HENAM
    May 17 '20 at 7:06
  • 1
    ctan.org/pkg/istgame?lang=en and ctan.org/pkg/forest?lang=en .
    – user194703
    May 17 '20 at 7:07

For game trees there is a specific package: istgame. The tag for this package was created only recently, so there are as of now not too many posts tagged istgame, but this may change. forest is generally a nice package for producing trees, and there are quite a few posts tagged forest. For your tree this package is certainly a possible choice.

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}}

enter image description here

However, it could very well be that istgame is closer to what you need on the long run. Needless to say that there are many more ways of producing trees, there is a tikz library called trees, the Graph Drawing Library trees, the tikz-qtree package and so on, i.e. this list is certainly not complete.

  • Thank you so much! It'll be of great help. It's really good to know new things in Latex.
    – HENAM
    May 17 '20 at 9:35
  • Hey one more question, how to create arrows the above side of a node?
    – HENAM
    May 17 '20 at 9:52
  • @HENAM I am sorry, I do not understand "how to create arrows the above side of a node". Do you mean the grow direction of the tree?
    – user194703
    May 17 '20 at 13:10
  • Yes, so let's say, I need four arrows (2 on the lower side of a node and two on the upper side), and then, how to create a different node from any of those in those 4 arrows mentioned above?
    – HENAM
    May 18 '20 at 3:40

Here is an example of using the istgame package:

enter image description here




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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.