0

This is somewhat a follow-up question to xskak: Switching between notation styles.

I would like to create a command for a pawn move that either gives the name of the file in which the pawn is placed or gives the pawn symbol, depending on whether I have invoked the command \usetextfig or \usesymfig in the document.

I hope the following explains what I would like:

\newcommand*\bonde[1]{\if\usetextfig#1\else\figsymbol{P}}

and then use

\bonde{e}

to indicate a pawn in the e-file, but it doesn't work.

Can anyone help me create such a command?

I've tried looking at etoolbox documentation but couldn't figure out if there was anything useful for this.

1 Answers1

1

Sounds a bit odd requirement, but it would work like this (the symbol for a pawn is a small p not P).

\documentclass{article}

\usepackage{chessfss}
\makeatletter
\def\testchessfiglanguage{\cfss@textfiglanguage}
\newcommand*\bonde[1]{\ifx\cfss@figlanguage\testchessfiglanguage #1\else\figsymbol{p}\fi}
\makeatletter
\begin{document}
 \bonde{e} \usetextfig \bonde{e}
\end{document}

enter image description here

Ulrike Fischer
  • 327,261