Is there a way to write a chapter title using chess figurines? I'm using the skak package and

\chapter{\mainline{1.e4 e6 2.d4 b6}}

doesn't work. Same error using the \variation command.

I'll post the exact error output when I'll be back home if needed.


2 Answers 2


Using a parsing command like \mainline in an moving argument is very problematic. I would suggest to do the parsing outside with \hidemoves and to print the moves with xskak:


\hidemoves{1.e4 e6 2.d4 b6}





Since the contents of a \chapter (or any/most sectional headings) are moving/fragile (they end up in the ToC, for example), care should be taken. However, you can box the content and then insert the box as part of your chapter heading. This is also not fool-proof, but at least provides a means to obtain the desired output in the chapter heading:

enter image description here

\usepackage{skak}% http://ctan.org/pkg/skak
\begin{lrbox}{\mybox}\huge\newgame\longmoves\longmoves\mainline{1.e4 c5 2.Nf3 Nc6}\end{lrbox}

Since the contents of \mybox is fixed in terms of its typesetting, I've used \huge which is similar to that of the regular \chapter title (in book.cls).

Another (better) alternative would be to use the Chess Font Selection Scheme chessfss to construct your chapter/symbol headings:

enter image description here

\usepackage{chessfss}% http://ctan.org/pkg/chessfss
\chapter{Chess: \textsymking, \textsymqueen, \textsymrook, \textsymbishop, \textsymknight, \textsympawn}

This works well with inserting the content in the ToC without problem. See the chessfss documentation for more details on how to modify the symbol masks and colours.

  • thank you. I'll try chessff and if it works for me (as I hope) and I will not receive any solution using skak I'll vote your answer as the best one ;)
    – MementoMori
    Aug 10, 2012 at 16:46
  • @MementoMori: What is it that you want exactly? A chess board, some pieces/symbols, or create a board via moves? You could capture the content of \mainline in a box and then use that as your chapter title. That is another alternative.
    – Werner
    Aug 10, 2012 at 16:54
  • capturing the output of \mainline (or \variation) and reusing it would be a great solution!
    – MementoMori
    Aug 10, 2012 at 17:14
  • @MementoMori: I've updated my answer to reflect a box-capturing technique. It depends highly on your usage though.
    – Werner
    Aug 10, 2012 at 20:15
  • thank you for sharing your knowledge but I've tried the solution offered by Ulrike and it seems a little easier to use. Anyway I'm sure your answer will save me time and headhaches in the future. Thank you again. Aug 13, 2012 at 20:35

You must log in to answer this question.

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