Beautiful extensive form games in Typst

typst

The pi-game-trees library provides Typst macros for drawing extensive-form game trees of the kind used in graduate and advanced undergraduate game theory courses. It is built on @preview/cetz:0.5.2 and requires no other dependencies beyond Typst itself.

The library covers the full vocabulary of extensive-form games:

  • game-node: a decision node for a named player, drawn as a filled or outlined circle in that player’s colour.
  • game-nature: a Nature / chance node, drawn in neutral grey.
  • game-terminal: a terminal (leaf) node with a coloured payoff vector.
  • game-branch: a directed edge with an optional action label, placed either on the branch line or to its east or west side.
  • game-prob: convenience wrapper around game-branch that renders the label in Nature’s grey — intended for probability annotations.
  • game-infoset: an information set connecting two or more decision nodes, drawn either as a dashed line or as a rounded bracket ribbon.
  • game-subgame: a proper-subgame triangle marker (Osborne–Rubinstein style).
  • game-highlight: a bold coloured overlay for marking equilibrium paths.
  • game-payoffs, game-player, game-player-default: inline text helpers for body text and captions.

Link: https://github.com/piotr-m-kuszewski/Pi_games_Typst/

Challenger-incumbent game

Battle-of-sexes game

Game with incomplete information

Signalling game