- Account
- Join for Free
- Sign In
- Help & Info
- Privacy Notice
- DMCA
- Contact Us
- Terms Of Use
Typesetting Chess in L A T E Xwith the skak Package Version 1.3 Torben Ho mann e-mail: Torben.Hoffmann@motorola.com March 10, 2005 Abstract This user guide shows how to use an enhance- ment to the existing package for typesetting chess in L A T E X( skak ). The primary improvement over the old package is that it has become easier to typeset chess games with this new package. Contents 1 Change History 2 2 Terms of Usage 3 3 Acknowledgements 3 4 The Old chess Package Versus the New skak Package 3 5 How to use the skak Package 4 5.1 Handling of Variations .
. . .
. . 4 5.2 Changing the Font .
. . .
. . .
. 5 6 Installing the skak Package 5 6.1 Using the lambda Package . .
. . 5 7 Future Additions/Wish-list 5 7.1 Choosing Language for mainline 5 7.2 Algebraic Notation used for Typesetting .
. . .
. . .
. . .
. . 5 7.3 Fonts .
. . .
. . .
. . .
. . .
. . .
5 7.4 Optimisation of the Implementation 6 7.5 Test Suite . . .
. . .
. . .
. . .
. 6 7.6 Translating PGN Files . .
. . .
. 6 ... more.
less.
7.7 Typesetting e.p. after en passant moves .<br><br> . . .<br><br> . . .<br><br> . . .<br><br> . . .<br><br> . . 6 1 1 Change History Version 1.3 " Dirk B¨achle has reworked the typesetting of chess moves: 3 A new capture symbol has been intro- duced to make the spacing around it better.<br><br> 3 The gurine symbols have been im- proved so that the spacing around them are more uniform 4 it looks re- ally good now, at least to my eyes. 3 A proposal for what syntax the skak package should handle in the future has been included in the distribution. 3 The Informator symbols cnovelty d, ccomment d and cvarious d needed an- other pair of curly braces in order to work right within the cmainline d and cvariation d environments.<br><br> 3 The check for trailing spaces in the macro ctypeset@cmoves d had to be re- moved because it led to problems at the end of a cmainline d or cvariation d environment when an additional Infor- mator symbol was involved. " A reference to the pgn2ltx tool created by Dirk B¨achle has been added to the docu- ment. " A reference to an URL decribing the PGN standard has been added.<br><br> Version 1.2 " Dirk B¨achle has 4 once again 4 done a great job: 3 the informator symbols have been im- proved and now scale as they should (I have in the same go done some Metafont clean-up associated with the symbols). 3 he has also discovered that the selec- tion of other fonts for the typesetting of moves can be done by rede ning the \skakfamily command! 3 added the \movecomment for \x2exible typesetting of comments 4 see the Reference Manual for details.<br><br> 3 The PostScript le are now 10 times smaller (for large les) and a compre- hensive test of the PostScript orna- ments has been created. " All dead code has been removed from skak.sty . Version 1.1 " Dirk B¨achle 9s enhancements have been in- corporated: 3 extension of the \highlight com- mand; it now accepts X, x, O and o as optional arguments and produces a cross and a circle on the square, re- spectively, instead of a frame around the square.<br><br> 3 unwanted generation of spaces re- moved. 3 a set of Informator symbols were added to the fonts and made available through commands documented in the informator.ps le. " Two xes by Ulrike Fischer have been in- corporated: 2 3 a bug in \ParseCoordinates .<br><br> 3 a problem in the fonts regarding size. " Ulrike Fischer reported a problem with opening spaces causing the input to be ignored 4 this has been xed and test/test2.tex veri es this. Version 1.0 The major novelty in this release is that the doc- umentation has been updated and a reference manual has been created.<br><br> 2 Terms of Usage This package is distributed under the terms de- scribed in the Latex Project Public Licence, i.e., This software is copyright but you are granted a license which gives you, the cuser d of the software, legal permission to copy, distribute, and/or modify the software. However, if you modify the software and then distribute it (even just locally) you must change the name of the software to avoid confusion. 3 Acknowledgements I would like to thank the creator of the lambda package, Alan Je rey, for making a splendid package that made this package possible.<br><br> For discussions and alpha-testing I send my thanks to Guido Governatori 4 some of his ideas have already been implemented; the rest? Time will show. Thanks to Harri Haanpaa for nding a nasty bug in the castling routine.<br><br> A big thank goes to Dirk B¨ achle for adding the Informator symbols to the fonts and for remov- ing a couple of nasty bugs as well as improving some of the commands. I thank Ulrike Fischer for spotting as well as xing a big problem with the parsing of moves and for her hints to improving the fonts. 4 The Old chess Package Ver- sus the New skak Package The main reason for considering an improvement of the chess package that Piet Tutelaers made back in 1991 is the cumbersome user interface the package has when one wants to write about a chess game and display a diagram every now and then.<br><br> Typesetting the two opening moves where white and black move their kingside knights is done as follows in the chess package: \move g1f3 g8f6 The package then produces a nice type- setting of these moves in gurine notation, but it is hard to keep track of what is go- ing on because one usually uses the SAN (Short Algebraic Notation, employed in the PGN standard for typing the moves 4 see http://pgn.freeservers.com/standard.txt for details) to write down the moves of a chess game. The SAN version of the two moves above is: 1. Nf3 Nf6 , which is much clearer to most chess players.<br><br> In the skak package the author of a chess article is allowed to use the SAN notation as input to the command that updates the chess board. In addition to making it easier for the author to write about chess using a familiar notation it also provides an easy way to include moves generated by a chess program 3 such as xboard in the document 4most other chess programs can also output a PGN version of a chess game and from that you can extract the SAN recording of the moves. The skak package can also input chess board positions given in the FEN notation (also used in the PGN standard), which is also quite standard in the domain of chess programs.<br><br> Apart from a better user interface the skak chess font contains three small modi cations of the font created by Piet Tutelaers: the knight now looks a bit more cyouthful d, the contour of the queen has been smoothened and all the chess pieces have been shrunk such that they do not ll as much of a square as before. I nd this font nicer to look at, but your milage may vary. 5 How to use the skak Package Writing about a chess game can be done straight- forward: \newgame \mainline{1.<br><br> e4 e5 2. Nf3 Bc5} starts a new game and produces the following in your document: 1 e4 e5 2 N f3 B c5 So far, so good. If you want to show the cur- rent position you just type \[\showboard\] in your document to get: 8 rmblkZns 7 opopZpop 6 0Z0Z0Z0Z 5 Z0a0o0Z0 4 0Z0ZPZ0Z 3 Z0Z0ZNZ0 2 POPO0OPO 1 SNAQJBZR a b c d e f g h (the use of math \[...\] is just to make sure the board is centered.) This is the basic functionality of the skak pack- age, but it o ers many di erent ways in which one can talk about chess games.<br><br> I think that a good way to show how the skak package can be used is to typeset the Fischer 3Tal game from the old chess package. The result is in the le named tuggame.ps . Further information about all the bells and whistles the skak package provides can be found in the Reference Manual where all commands of relevance are described.<br><br> 5.1 Handling of Variations The skak package does not support PGN varia- tions such as \mainline{12. Bb4 (12. Ng5 h6) 12...<br><br> Ra8} %gives an error You have to type this as \mainline{12. Bb4} \variation{12. Ng5 h6} \mainline{12...Ra8} 4 I do not have the nerves to update the parsing algorithm to cope with this so the best thing to do would be to craft a tool for translating PGN to T E X(see 7.6).<br><br> 5.2 Changing the Font (New in Version 1.2) Dirk B¨achle has discovred that you can change the font used for typesetting of moves if you re- de ne the \skakfamily font. I do not 4 however 4 know how to handle di erent chess fonts, so if someone could work this out I 9ll include that in a future version. 6 Installing the skak Package I could not get the make le to do the job, so if someone could help me out on this I would be very glad indeed.<br><br> Basically all you have to do is to follow the guidelines in the make le. First you create all the required directories (stated in the install section of the make le) and then you run the make install command. Remember to run texhash after you have updated your texmf tree.<br><br> Sorry that it is not working 100% 4 I just do not have the time for it right now. If you cannot get the things working just put the les where T E Xand the other tools can nd them and you will be just ne. 6.1 Using the lambda Package The skak package uses the lambda package to do some of the hard processing necessary to allow the PGN notation as input 4 since it is not stan- dard in L A T E Xdistributions it is included in the distribution of the skak package.<br><br> 7 Future Additions/Wish-list 7.1 Choosing Language for mainline (Proposal date: mid 2002.) It would be nice if one could choose the language for the mainline , variation and \hidemoves for each invocation as it allows for easier inclusion of analysis from chess programs when using a non-english language. 7.2 Algebraic Notation used for Type- setting (Proposal date: mid 2001.) Ingo Sander has suggested that the output of the typesetting should be the old algebraic no- tation where the from and to squares always are given. This requires a modi cation to the game engine: after each move has been made you should store the algebraic notation of the move since you have the to and from squares calculated at that moment.<br><br> Changing the game engine is a bit hairy 4 even for me 4 so I 9ll postpone this. 7.3 Fonts (Proposal date: dec-2002.) Ulrike Fischer has suggested the creation PostScript version of the Metafont font. I do not know how to do this, but perhaps someone can help me?<br><br> Furthermore, Ulrike Fischer would like to see a more transparent fonthandling, so that it be- comes easy to change to another chess-font. (Version 1.2 news: see Section 5.2.) 5 7.4 Optimisation of the Implementa- tion (Proposal date: 2-Jan-2003.) I would like to improve some areas of the im- plementation since they are unnecessary slow and/or complicated, e.g., \IsPieceName could easily be implemented as a case statement in- stead of a list look-up. I have a strong feeling that this would be a lot faster than the current implementation which has a very functional pro- gramming \x2avour 4 this was very helpful during the development, but it has a tendency to be a bit ine\x3cient.<br><br> Another great improvement would be to let the commands \Mainline and \typeset@A use the same parsing algorithm 4 then one could implement the long algebraic notation as sug- gested by Ingo Sander by letting the action taken on a move be both updating of the board and typesetting of the move! 7.5 Test Suite (Proposal date: 03-Jan-2003.) It would be a very good idea to create a test suite created using normal testing techniques. Areas of test should include: " resolving ambiguous moves, i.e., ensuring that moves like R ad1 moves the right rook.<br><br> " all legal SAN moves are accepted. 7.6 Translating PGN Files (Proposal date: 03-Jan-2003.) It would be very nice if one had a command line tool that could translate PGN les to a T E X le. 27-Sep-2003: Take a look at http://pgn2ltx.sourceforge.net for a nice helper tool.<br><br> 7.7 Typesetting e.p. after en passant moves Andreas Wilm asked how one should input en passant moves, especially the addition of e.p. af- ter the capture.<br><br> This is not part of the SAN notation as de- scribed in the PGN standard and it requires that the improvement described in Section 7.4 is in place before it is possible to add the possibility to add the e.p. . It has to be this way because I do not want to support more than what is described by the PGN standard.<br><br> 6