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.

1
  • Welcome to the TeX.SE. solar community.
    – Sebastiano
    Feb 21 at 22:21
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.