# Custom chessboard axis labels

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.

• Welcome to the TeX.SE. solar community. Feb 21 '21 at 22:21

## 1 Answer

\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}



• Kindly, I was writing in my first comment that the appropriate user was you :-) Feb 21 '21 at 22:37