7

I would like to know how to include chess symbols in normal text in LaTeX. I have looked online but the packages chess.sty or skak are too old or they display chessboards.

1
  • 2
    Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count. This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!).
    – doncherry
    Jul 9, 2011 at 19:09

4 Answers 4

7

skak works fine, just try the \symXXX symbols, which are suited for in-text use:

\documentclass{article}

\usepackage{skak}

\begin{document}

This is some normal text with chess symbols included, first off the king \symking,
followed by the queen \symqueen, and finally a pawn \sympawn.

\end{document}

enter image description here

You can retrieve a full list of the symbols on page 94 of the The Comprehensive LaTeX Symbol List.

4
  • Thank you, I seem to have skak installed (using TeX Live) but I get an error of unknown command "\symking" Jun 3, 2011 at 19:21
  • @Alejandro: Hmm, I use MiKTeX, so I can't give you any really specific advice, but: 0) Do you only get an error message for \symking or for the other skak commands as well? 1) Make sure you included \usepackage{skak} in the preamble. 2) Make sure your TeX Live and the skak package itself are up to date. 3) Try to compile the above sample and post all error messages or warnings you get here. (btw, you can mark mark code in your comments, too, just like in a question, by using backticks ` (cf. meta.tex.stackexchange.com/questions/863/…)
    – doncherry
    Jun 3, 2011 at 19:46
  • @Alejandro: For me it works with both TL 2009 and 2010.
    – Caramdir
    Jun 4, 2011 at 0:12
  • 2
    @Alejandro: \symking is defined by the chessfss package. Newer versions of skak load this package for the font handling, but if doncherry's example doesn't work for you your skak version is probably old. Replace \usepackage{skak} by \usepackage{chessfss} or get a newer skak.sty. Jun 5, 2011 at 15:31
4

With XeTeX or LuaTeX, you can use any OpenType or TrueType font in your document. So if you happen to have a nice chess font, you can use that.

Unicode includes the chess symbols. So the symbols are actually included in some text fonts. If you use such a font, you can simple use the Unicode character in the text to get the symbol (though it is probably more convenient to define a command).

% Compile with xelatex or lualatex
\documentclass{article}
\usepackage{fontspec}

% Free Serif includes the chess symbols. Change to the font of your choice.
\newfontface\chess{Free Serif}

\newcommand\wking{{\chess ♔}}   % if your font includes the symbols in a position
\newcommand\wqueen{{\chess ♕}}  % different from the position Unicode specifies,
% etc                           % change the ♔ accordingly.

\begin{document}
\noindent
The \wking\ asked\\
The \wqueen, and\\
The \wqueen\ asked\\
The Dairymaid:\\
"Could we have some butter for\\
The Royal slice of bread?"
\end{document}

example

(With apologies to A A Milne.)

2
  • Anybody know how to make these pawns colored or with a colored border? Dec 11, 2017 at 3:11
  • @InfiniteDifferenceMethod I would assume that normal \textcolor etc works.
    – Caramdir
    Dec 13, 2017 at 19:51
1

Is chessfss the sort of thing you're looking for?

0
0

I've never used it myself, but it looks like http://www.ctan.org/pkg/texmate may be the package you're looking for.

EDIT: TexMate includes skak and chessfss.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .