# Make diagrams in Latex of Game theory

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

• 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? May 17 '20 at 7:06
• – 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.

\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
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}}
[a
[{(2,2)},el'=f]
[b,el=g
[{(0,0)},el'=n]
[{(1,3)},el=y]
]
]
\end{forest}
\end{document}


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. May 17 '20 at 9:35
• Hey one more question, how to create arrows the above side of a node? 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? May 18 '20 at 3:40

Here is an example of using the istgame package:

\documentclass{standalone}

\usepackage{istgame}

\begin{document}

\begin{istgame}
\tikzset{oval node/.style={ellipse node,draw=none}}
\xtShowArrows[oval node]
\xtdistance{15mm}{30mm}
\istrooto(0){a}
\istb{f}[al]{(2,2)}
\istb[->-=.92]{g}[ar]
\endist
\istrooto(1)(0-2){b}
\istb{n}[al]{(0,0)}
\istb{y}[ar]{(3,1)}
\endist
\end{istgame}

\end{document}