4

i'm using the skak-package for some chess notation in a presentation. My only issue: How can i highlight various squares on the chessboard? Basic:

\documentclass[12pt]{beamer}
\usepackage{skak}

\begin{document}
\begin{frame}
\newgame
\fenboard{8/8/8/3Q4/8/8/8/8 w - - 0 0} % FEN-notation, only one Queen
\showboard
\end{frame}
\end{document}

For example, i want to show the possible movements for a Queen on the board. I've tried the \highlight{} command (see below), but it throws errors.

\documentclass[12pt]{beamer}
\usepackage{skak}

\begin{document}
\begin{frame}
\newgame
\fenboard{8/8/8/3Q4/8/8/8/8 w - - 0 0} % FEN-notation, only one Queen
\showboard
\highlight{d4,d6}
\end{frame}
\end{document}

Shown Error: !Undefined control sequence. <recently read> \c@lor@to@ps l.49 \end{frame}. I use Texmaker with PdfLatex.

So, whats wrong?

norb
  • 43
  • Welcome to TeX.SX! The skak package seems to need pstricks which, by itself, is not compatible with pdflatex – egreg Dec 04 '14 at 12:00
  • See http://tex.stackexchange.com/questions/8413/how-to-use-pstricks-in-pdflatex – egreg Dec 04 '14 at 12:01
  • Thanks! I tried xelatex: no errors, but also no highlighting. Then trying latex->dvips->ps2pdf showed everything - but: The highlighting is just a black border around the selected squares. Is there an option to color the square? – norb Dec 04 '14 at 12:09

1 Answers1

6

For the highlighting skak uses pstricks and you must load skak with the ps-Option:

 \usepackage[ps]{skak}

But I would suggest to use chessboard instead which will work with pdflatex:

\documentclass[12pt]{beamer}
\usepackage{skak} %or xskak
\usepackage{chessboard}
\begin{document}
\begin{frame}
\newgame
\chessboard[setfen=8/8/8/3Q4/8/8/8/8 w - - 0 0,
            pgfstyle=border,markfields={d4,d6},
            color=blue!50,
            colorbackfield=c5,
            pgfstyle=color,
            opacity=0.5,
            color=red,
            markfield={d5}] 
\end{frame}
\end{document}

enter image description here

Ulrike Fischer
  • 327,261