• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

How to typeset chess games with LaTeX

Contents

  • Chessboard
    • Simple example
  • Skak
    • Simple example
  • See also

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

  • Chessboard documentation
  • Skak documentation - short reference

Published

Jan 8, 2017
by Martin Thoma

Category

Cyberculture

Tags

  • LaTeX 29

Contact

  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor