[Tex/LaTex] Numbering chess diagrams (skak)

chessdiagramsxskak

How do I put a number beside the chess diagram?

I want to make a document of chess diagrams to be solved and then the solutions at the end. If someone has a skeleton to make this I would be happy.

Thanks in advance!


Thanks for the quick answer.

Is it possible to change the notation numbers of the board to right side? In that case it would be good to have the number to the left (and up) of the diagram. If that is not possible, would it be possible to position the number between where the white or black move mark is. To the right of the diagram. I have several positions in one row like this:

\begin{tabular}{c}

\newgame
\def\myfen{8/8/8/pk6/8/P1K5/1P6/8 b - - 0 1}
\chessboard[tinyboard,setfen=\myfen]

\newgame
\def\myfen{8/8/8/pk6/8/P1K5/1P6/8 b - - 0 1}
\chessboard[tinyboard,setfen=\myfen]

\end{tabular}

Best Answer

Well you can simply use a counter

\documentclass[12pt,a4paper]{article}
\usepackage{xskak}
\newcounter{chessex}
\newcommand\printchessex{\refstepcounter{chessex}\thechessex}
\begin{document}

\chessboard\hfill\printchessex

\chessboard\hfill\printchessex

\end{document}

But I would suggest one of the packages for question/answer sheets, e.g. answers or exams.