Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}

Chess pieces symbols within normal text

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.

share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

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}

enter image description here

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.

share|improve this answer
    
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
add comment

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}
\usepackage{adjustbox}

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

Output with the new commands defined from the board pieces

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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