For my game theory course I needed to typeset extensive-form games in LaTeX documents. One way of doing this to use the egameps package written by Martin Osborne. Osborne is the author of two excellent game theory texts, and he has shown the same care in this package which has a very pleasing syntax and produces quite nice output. This package is based on the pstricks package which means that it will not work with pdfTeX. You need to compile to DVI, then to Postscript and then to PDF which is cumbersome, though some LaTeX environment do provide a shortcut for this pipeline.

A newer way of producing drawings in LaTeX is the PGF/TikZ packages which support pdfTeX. TikZ also has lot of built in support for drawing trees which means that unlike egameps one does not have to calculate coordinates for the nodes manually. To typeset a game tree we use `node`

to define the game nodes, `child`

to describe their hierarchical relationship and `edge from parent`

to style and label the edges. The details are in Chapters 1–3 and 16 of the PGF/TikZ manual.

## A Minimal Example

Suppose you want to typeset this tree

The LaTeX code would be

```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}
\begin{center}
\small
\begin{tikzpicture}[thin,
level 1/.style={sibling distance=40mm},
level 2/.style={sibling distance=25mm},
level 3/.style={sibling distance=15mm},
every circle node/.style={minimum size=1.5mm,inner sep=0mm}]
\node[circle,draw,label=above:$1$] (root) {}
$2$] {}
child { node [circle,fill,label=above:
child { $3,2$}
node {
edge from parent$D$}}
node[left] {
child { $6,4$}
node {
edge from parent$C$}}
node[right] {
edge from parent$Z$}}
node[left] {$2$] {}
child { node [circle,fill,label=above:
child {
node[circle,fill] (node-A) {}
child {$3,0$}
node {
edge from parent$X$}}
node[left] {
child {$8,5$}
node {
edge from parent$Y$}}
node[right] {
edge from parent$A$}}
node[left] {
child {
node[circle,fill] (node-B) {}
child {$4,6$}
node {
edge from parent$X$}}
node[left] {
child {$2,1$}
node {
edge from parent$Y$}}
node[right] {
edge from parent$B$}}
node[right] {
edge from parent$W$}};
node[right] {\draw [dashed] (node-A) -- (node-B)
$1$};
node[midway,above] {\end{tikzpicture}
\end{center}
\caption{Example: Extensive-form games in TikZ}
\end{figure}
\end{document}
```