in chess, kid

Easy chess games for kids (mate in one)

UPDATE: You can get a much better revised version of the PDF now, with coordinates, in this newer post.

In my journey to teach chess to Ido, an easy (I thought) job was to generate diagrams where he has to find mate in a fixed number of turns. Starting with mate in one.
It appeared that making diagrams is an easy task, as there are many programs (Linux and Windows) that permit this.
On Linux, the best I could find is scid. That’s cool as I use it to maintain my databases of games. Even cooler, is that scid development has just restarted (stopped around 2004!), with the help of Pascal Georges. Using scid (I’m using the 3.7devel2009 version) I can export games to HTML or even to LaTeX files.

At first I thought I’d create the endings myself, for example, using online diagrams generators or using Wikipedia/MediaWiki’s templates, but it was not so easy, so I thought about making a program to generate them.
Generating one from scratch would take me time I really don’t have, and there are just two python modules that give high-level functions to chess.
So I started looking for projects similar to mine, that include games with mate in one. I found a small database of mate in one on my favorite chess website, in the download section: a Chessbase datafile with 1171 mate in one studies! So cool.

Well, It was really a pain to convert that Chessbase (.cbv) file, as the only program able to convert to PGN is running on Windows (at least it’s free). You just have to follow the instructions from this thread.
After getting a nice PGN file, just open it with scid, go to “Tools”, then select “Write the filter”, and choose LaTeX. You’ll get a TeX file. Use you favorite TeX generator (Live TeX seems to be the one today), like this for example, to generate directly a PDF file:

cat mat_temp.tex |grep -v "\\\\$" > mate_in_one.tex
latex --output-format=pdf mate_in_one.tex

(Yes I had to cleanup a bit the file before generating the .pdf)

The result is here, 196 pages of tests (6 one each page) if you don’t want to fight with the missing TeX modules (you’ll need chess12.sty) and get a nice result.

I’m sure many people search for this kind of file, so I’m pretty happy to help other parents/coaches.

White mate in one

White mate in one

Edit: I added a PDF version without the solution included.


Write a Comment




  1. Very useful indeed. Is there a way to generate the pdf without the answers right below? Then they’d be fantastic as worksheets.

  2. It sounds like you went to a lot of effort to produce these pdf files so thanks for taking the time and having the good nature to post them for anyone to use. i have been using them with young pupils who have stated an interest in learning chess and they are proving to be a simple and easy way to learn the rules and play some games.

  3. Nice to see someone taking the time to do this, presumably from the goodness of your heart as opposed to financial gain. Teaching youngsters to play chess is one of the best things you can do for their development.

  4. Respected Sir,

    Your effort is truly speechless….!!!!

    I had got tex file but I am stuck up after it….what to do…?

    Can you please email me…?



    Kunal Shah

  5. Respected Sir,
    Entire first will you please tell with which software should I generate .tex or .ltx file…scid or pascal georges…?

    After creating .tex for example k.tex When I open k.tex file on the header it shows….
    % This is a LaTeX file generated by Scid.
    % You must have the “chess12” package installed to typeset this file.
    so where can I get chess12.sty..?
    other question is in your below commands do I have to mention my file name instead of mate_in_one.tex ?
    cat mat_temp.tex |grep -v “\\\\$” > mate_in_one.tex
    latex –output-format=pdf mate_in_one.tex

    As I had tried a lot to find above commands but my efforts were useless..

  6. @Kunal: You need to get the chess12.sty module from the CTAN archive, which is on
    Download the .zip, extract it, run ‘make’ and then ‘make install’.

    About the filename, the name mate_in_one.tex is the name I set when generating the tex file from the pgn file, using Scid.
    Just rename it to mat_temp.tex to clean it up, and then do :
    cat mat_temp.tex |grep -v "\\\\$" > mate_in_one.tex
    latex --output-format=pdf mate_in_one.tex

  7. Respected Sir,
    In my Laptop Windows 7 is installed. Do I need to install Linux or current operating system Windows 7 is enough..? I don’t know anything about Linux. Since 2 weeks I am asking my friends’ if they can help me..
    About chess12.sty..where do I have to install & as you had told run ‘make’ and then ‘make install’ these files I can see but with which program it will be open. If I am not wrong chess12.sty isn’t there in the above zip file..chess.sty is what I can see.
    Sir it’s my humble request if you can post screenshots in a zip file how do u generate PDF file then I will be HIGHLY OBLIGE OF YOU.
    I am downloading TeX Generator (Live TeX) from
    Is it ok or not..?
    Is it possible to generate PDF file having co ordinates all the sides in each & every diagram so that students(Especially between 4 – 6 yrs) can easily write answer.
    Thanks in Advance

  8. I’m personally using Linux, so I can’t really help you on Windows. I guess it’s possible to install TeX Live or teTeX, but I think that will not be easy (requires a lot of libraries, and maybe the Cygwin tools also).
    About the chess12.sty, the name of the package is chess12, but inside you’ll have the chess.sty file which is the required one, not chess12.sty.
    What are these screenshots you want? I don’t understand. Screenshots of what?
    I can’t add coordinates (you’re right that would be nice to have them), because the chess12 package doesn’t support them at all. There are other TeX packages that support them (chessboard, skak, skaknew, etc.) but the tool (scid) I have to convert PGN to TeX only supports that chess12 package.

    If I find a converter that supports these other packages, I’ll generate what you asked with pleasure!