I've 855 positions in .pgn, which notations I want to export to .tex file. How can I do this? Should I do all of them one by one? In ChessBase, I can export them as .pdf file, but I cannot copy codes to .tex file, which I prepare. Also, I need a numeration. I've also tried pgn2latex, but my latex software didn't compiled the output file.

Something like this (font doesn't matter, main is a format):

enter image description here enter image description here

Or this, but without the separation line.

enter image description here

With regards, Ulvi Bajarani

  • can you show the input as a text file, not as an image? – David Carlisle Jun 22 at 15:38
  • The documentation of xskak has a section with comments about inputting from a file (but it is from 2014 or so, so things can have changed). On the whole you probably will have to write some preprocessor (and the pgn shouldn't contain to many variations and comments ...). – Ulrike Fischer Jun 22 at 15:44

Have you tried the pgn2latex suggested here: https://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=32208

Tell us how it turn out. The only catch is you have to run python.

  • I've tried, but it didn't compile the .pgn, due to $ signs – Ulvi Bajarani Jun 27 at 15:42
  • Can you do a simple MWE of what you want exactly? I wish to learn from your experience as well. As for solution, another alternative is to open your pgn in scid. Using scid, you can export all the games to LATEX. But I must warn you, SCID's latex output is a bit cumbersome. You will get 1 page for each position. On the positive side, they provide a latex position for each game. It all depends on what you want. – user92127 Jun 27 at 20:08
  • I've opened all .pgn in Notepad++, and substituded all signs and commands (White, Black, Event, $19) with replacement (\whitename, \blackname, \WBetter, ! etc.) I've merged events, deleting cities. It's too handy, of course, but understanding, you can substitute all commnads by one click, controlling them. – Ulvi Bajarani Jun 27 at 20:26
  • I've forgotten to write that pgn2latex cannot compile notation without FEN, showing that the move number is other that 1. – Ulvi Bajarani Jun 27 at 20:44
  • Your experiment is very interesting. What is your desired output? A worksheet? A game analysis? Do you just want to recreate the same output as chessbase? Can you put in a sample MWE to illustrate? – user92127 Jun 27 at 20:48

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.