# How to display black chess pieces within normal text with chessfss

I'm using the package chessboard do display chess diagrams, and therefore chessfss is used for chess fonts if my understanding is correct.

To display the white chess pieces within normal text when writing explanations, I use the commands \pawn, \rook, \knight, \bishop, \queen and \king (see the example below).

\documentclass[varwidth,margin=0.5cm]{standalone}
\usepackage{chessfss}
\begin{document}
White pieces : \pawn \rook \knight \bishop \queen \king\\

Black pieces : \BlackPawnOnWhite \BlackRookOnWhite \BlackKnightOnWhite
\BlackBishopOnWhite \BlackQueenOnWhite \BlackKingOnWhite
\end{document}


What are the corresponding commands to display the black pieces? I have tried commands like \BlackPawnOnWhite but as you can see it is not suited to in-text use.

There aren't many chessfonts which actually contain black figurine pieces. I only know the berlin family and there you need to change the font shape to access them:

\documentclass[varwidth,margin=0.5cm]{standalone}
\usepackage{chessfss}
\begin{document}
\pawn \rook \knight \bishop \queen \king

\setfigfontfamily{berlin}
\pawn \rook \knight \bishop \queen \king

\fontshape{bl}\pawn \rook \knight \bishop \queen \king
\end{document}


If you want to use another chess font you will have to get suitable glyphs first. You could e.g. ask the author of skaknew to add them. I could then create support files.

# Edit

You could get glyphs by taking the font with the board pieces and then create a virtual font which changes the bounding boxes so that they sit better on the line.

• Thank you for you answer! Since I have to manually install the chess fonts in Fedora, I'll look further into it when I have some time. – remjg Dec 15 '13 at 12:54
• Where to find the berlin font? – Paul Gaborit Jan 10 '17 at 16:03
• @PaulGaborit: It is in the enpassant package (on CTAN). With miktex you can install it with the package manager, with texlive you will have to do it manually. – Ulrike Fischer Jan 10 '17 at 16:06

Since I almost don't understand anything about fonts, I have defined using adjustbox new commands which trim, resize and scale the board pieces. It is kind of an ugly workaround, I know...

\documentclass[varwidth,margin=0.5cm]{standalone}
\usepackage{chessfss}

\newcommand{\pawnB}[1][1.3ex]{%
\adjustbox{Trim=4.3pt 2.6pt 4.3pt 0pt,width=#1,margin=0.2ex 0ex 0.2ex 0ex}{\BlackPawnOnWhite}%
}%
\newcommand{\rookB}[1][1.58ex]{%
\adjustbox{Trim=3.2pt 2.2pt 3.2pt 0pt,width=#1,raise=0ex,margin=0.1ex 0ex 0.1ex 0ex}{\BlackRookOnWhite}%
}%
\newcommand{\knightB}[1][1.85ex]{%
\adjustbox{Trim=2.3pt 2.35pt 2.5pt 0pt,width=#1,raise=-0.03ex,margin=0.14ex 0ex 0.14ex 0ex}{\BlackKnightOnWhite}%
}%
\newcommand{\bishopB}[1][1.79ex]{%
\adjustbox{Trim=2.3pt 2pt 2.3pt 0pt,width=#1,raise=-0.12ex,margin=0.1ex 0ex 0.1ex 0ex}{\BlackBishopOnWhite}%
}%
\newcommand{\queenB}[1][2.05ex]{%
\adjustbox{Trim=1.2pt 2.2pt 1.2pt 0pt,width=#1,raise=-0.08ex,margin=0.1ex 0ex 0.1ex 0ex}{\BlackQueenOnWhite}%
}%
\newcommand{\kingB}[1][1.95ex]{%
\adjustbox{Trim=2pt 2pt 2pt 0pt,width=#1,raise=-0.06ex,margin=0.13ex 0ex 0.13ex 0ex}{\BlackKingOnWhite}%
}%

\begin{document}
\pawn  \rook   \knight   \bishop   \queen  \king\\
\pawnB \rookB  \knightB  \bishopB  \queenB \kingB
\end{document}


The alpha font family has black figurines stored within \fontshape{bl}.

\documentclass{article}

\usepackage{chessfss}

\begin{document}

\setfigfontfamily{alpha}

\figfont KQRBNp

\fontshape{bl}\figfont KQRBNp

\fontshape{*}\figfont KQRBNp

\end{document}


The issue with the piece sizes can be resolved with the following:

\usepackage{chessfss}
\setboardfontsize{10pt}

• It only changes the size of the pieces, not their positions. – Luc Jan 10 '17 at 15:21