Typesetting Chess Games
AS
Aman Saurav
7 min read
#chess
#games
LaTeX isn’t just for science; it’s great for games too. The skak and xskak packages allow you to typeset chess games and diagrams using Standard Algebraic Notation (SAN).
Printing a Board
To print a specific board position using FEN (Forsyth-Edwards Notation):
- Package:
\usepackage{skak} - Command:
\fenboard{...}
\fenboard{rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1}
\showboard
Annotated Games
You can write moves and let LaTeX track the board state automatically.
\newgame\mainline{1. e4 e5 2. Nf3 Nc6}\showboard
