How to typeset chess games with LaTeX

· by

Contents

Chessboard

Simple example

Chessboard - simple example
Chessboard - simple example
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{5mm}

\usepackage{chessboard}

\begin{document}
\begin{preview}

\chessboard[setfen=5rk1/pp3N1p/4P3/2P5/3Q1PK1/P7/1Pr3pq/R3R3 w - - 0 0,
            showmover]

\end{preview}
\end{document}

From tex.stackexchange.com.

Skak

Simple example

Simple example with skak
Simple example with skak
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{5mm}

\usepackage{skak}

\begin{document}
\begin{preview}

% sets the internal board or a new game
\newgame
% typesets the moves and updates the board
\mainline{1.e4 e5 2. Nf3 Nc6 3.Bb5}\\
% show the current board position
\showboard

\end{preview}
\end{document}

See also