3

I would like to use the chessboard package to create a chess board, but with customized axis labels. The Latex below creates a board where the files are labelled with numbers instead of letters. I would like to label the files and ranks in non-sequential orders, for example "a, b, c, d, d, c, b, a", or "5, 4, 3, 2, 1, 1, 2, 3, 4, 5" on a 10x10 board.

\documentclass{article}
\usepackage{chessboard}

\begin{document}

\begin{frame} \newgame \chessboard[ setfen=rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2, labelbottomformat=\arabic{filelabel} ] \end{frame}

\end{document}

Some past questions have other labels, or sequences starting with 0, but all make use of sequential numbering. Page 37 of the chessboard documentation is promising but I haven't been able to get further.

Cenlle
  • 75

1 Answers1

5
\documentclass{article}
\usepackage{xskak,chessboard}

\newcommand\myfancynumbering[1]{%
 \ifcase#1 \or blub\or xxx\or a\or b\or 123\or c\or abc\or Bär\fi}
\begin{document}

\begin{frame}
\newchessgame
\chessboard[
    setfen=rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2,
    labelbottomformat=\myfancynumbering{\value{filelabel}}
]
\end{frame}

\end{document}

enter image description here

Ulrike Fischer
  • 327,261