LaTeX Hobbies Typesetting Chess Games

Typesetting Chess Games

AS
Aman Saurav
| Jan 23, 2025 |
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.

  1. \newgame
  2. \mainline{1. e4 e5 2. Nf3 Nc6}
  3. \showboard

Chess Board Output
Chess Board Output

Video Demo

Chess typesetting in LaTeX