How can I draw arrows on a chess game?

For example, if the game starts with 1. e4 ..., I want to draw a black arrow from e2 to e4 to show the movement, and, in the same diagram, two red arrows from e4 to f5, and another from e4 to d5, to show the pawn attacking the squares.

Following game works for me. I'd like to find additional highlighting possibilities. For example, for educational purposes, an arrow between the knight in f6 to the squares being attacked by it.



\mainline{1. e4 e5 2. Nf3 Bc5}

  • 1
    Your question leaves all the effort to our community, even typing the essentials of a TeX document such as \documentclass{}...\begin{document} etc. As it is, most of our users will be very reluctant to touch your question, and you are left to the mercy of our procrastination team who are very few in number and very picky about selecting questions. You can improve your question by adding a minimal working example (MWE) that more users can copy/paste onto their systems to work on. If no hero takes the challenge we might have to close your question.
    – Adam Liter
    Mar 14 '14 at 21:20
  • Also, welcome to TeX.SX!
    – Adam Liter
    Mar 14 '14 at 21:20
  • @Adam: done (I think). Mar 14 '14 at 21:29
  • 1
    Read the documentation of the chessboard package. Mar 14 '14 at 23:08
  • Especially page 29. Mar 15 '14 at 2:06

I followed the documentation of the xskak package, especially pages 35 and 36, and this is what I've got.

%! *latex mal-chess.tex
  {\equal{#1}{N}}%knight move
    {\equal{#1}{}}% castling
\hidemoves{1. e4 e5 2. Nf3 Bc5}%
%\chessboard[setfen=\xskakgetgame{initfen}]% Show me the empty board.
\chessboard[pgfstyle=\mymovestyle, color=blue,
  markmoves=\xskakget{move}, pgfshortenend=0.3em, arrow=to, coloremph, color=red, markstyle=circle, markfield=\xskakget{movefrom},
  emphfields=\xskakget{moveto}, setfen=\xskakget{nextfen}]
  }% End of \xskakloop...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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