TransWikia.com

Using skak/chessboard for problems, not games

TeX - LaTeX Asked by user36386 on February 12, 2021

I want to use skak/chessboard to make the diagram of a problem. This accomplishes what I want:

documentclass{article}
usepackage{skak,chessboard}

begin{document}

newgame
defmyfen{8/R7/1R6/6k1/8/5K2 w}
chessboard[setfen=myfen]
            
movecomment{1. Ra5 Kh4}
            
newgame
defmyfen{8/8/1R6/R7/7k/5K2 w}
chessboard[setfen=myfen]

end{document}

But I would have preferred to use mainline, instead of movecomment, after the first diagram so that I don’t have to type the new FEN position after every move. I understand that mainline expects a new game (and that’s why a get an error if I use it). Is there any other way to represent some position and its following moves when they’re not part of a game?

One Answer

You should be using the xskak package, not the skak package for more functionality. Then adapt Ulrike Fischer's answer here to your problem:

documentclass{article}
usepackage{xskak,chessboard}

begin{document}

newgame
defmyfen{8/R7/1R6/6k1/8/5K2 w}
newchessgame[setfen=myfen,moveid=16w]
chessboard

mainline{16. Ra5+ Kh4} 

chessboard        
end{document}

The result running in Gummi is: enter image description here

The documentation for xskak, which is an extension of the skak package can be found here on CTAN.

Correct answer by DJP on February 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP