Beautiful strategic form games in Typst
Strategic form games
Strategic form games are one of the first tools encountered by anyone studying game theory. However, a quick survey of the major textbooks does not inspire much satisfaction. I like the games in the textbook A Course in Game Theory by Ariel Rubinstein and Martin Osborne the most.
For LaTeX there is a fantastic package xgames, which helps draw strategic form games, extensive form games, and several other typical game theory diagrams. The author’s page for xgames can be found at https://www.benjamin-bernard.com and the source code repository is at https://github.com/Slyrk/xgames. The biggest advantage of xgames is that it draws games using TikZ. As a result, the final document looks really great.
Strategic form games in Typst
For Typst there is already the game theoryst package, which is available on Typst Universe https://typst.app/universe/package/game-theoryst/. This package has a much less ambitious feature set than xgames. It also has one very serious drawback. xgames uses TikZ to draw all games. This means that any table formatting has no effect on the operation of xgames. Unfortunately, game theoryst uses tables to draw games. Therefore all table settings are reflected in the formatting of games. In particular, settings for alternating row shading and header formatting will affect the appearance of games formatted with game theoryst.
The pi-games package https://github.com/piotr-m-kuszewski/Pi_games_Typst uses the same approach as xgames and the syntax of game theoryst. The idea is that games should be formatted as CeTZ drawings so that new graphical elements can be added easily. Using syntax similar to game theoryst makes it easy to transfer existing content to the new package. Ultimately, pi-games is intended to be developed to provide functionality similar to xgames.
Extensive form games
A fantastic tool for drawing extensive form games is fletcher https://typst.app/universe/package/fletcher, which is based on CeTZ https://typst.app/universe/package/cetz. However, a description of how to draw a well-looking extensive form game using fletcher and CeTZ is the topic for a separate post.