1
2


I finished a little python script for converting complex games to Latex (using mostly skak). Maybe you want to try it :-)
This looks interesting. Is it possible to get a Windows exe file for the program? Thank you.
Well, it is written in Python, so although you may be able to create an .exe with some tricks, you usually want to run it with the Python interpreter.
See https://docs.python.org/3/using/windows.html
In Linux you browse to the script folder (via "cd C:\Script" for instance in Windows) and execute it via "python3 pgn2latex.py" (in Windows maybe "py pgn2latex.py")
I fixed some bugs in that script, so I'll attach a new version.
See https://docs.python.org/3/using/windows.html
In Linux you browse to the script folder (via "cd C:\Script" for instance in Windows) and execute it via "python3 pgn2latex.py" (in Windows maybe "py pgn2latex.py")
I fixed some bugs in that script, so I'll attach a new version.
Here's a version numbering variations 1) 2) 2a) 2b) and so on. I'm not sure which behaviour is intended for numbering deep variations: 2aa) or 2a1)?
Btw., as you will have noticed, the code is pretty ugly :-) . Still, it works.
Btw., as you will have noticed, the code is pretty ugly :-) . Still, it works.
Attachment: pgn2latex2John.zip (10k)
Thank you Felix for the new version. The output from this script is much nicer than from the Aquarium print game option.
I see your point about deep variations as it could get confusing but either version is understandable to me as a user.
John
I see your point about deep variations as it could get confusing but either version is understandable to me as a user.
John
Glad you like it :-)
Btw., don't forget to set "copy only moves and text comments" in the Aquarium options (pgn options there). Otherwise coloured moved will appear as strange strings in the text.
Btw., don't forget to set "copy only moves and text comments" in the Aquarium options (pgn options there). Otherwise coloured moved will appear as strange strings in the text.
Here's a much nicer version from typographical point of view. Now you are ready to typeset your own chess book ;-)
OK, I found out that my formatting was truly horrible, so here's a new version.
Attachment: pgn2latex3.zip (221k)
And here's the latest version using a three column style
Attachment: pgn2latex3.zip (18k)
i have to point out while nicely done, who uses paper anymore, it's all on the web now
are there public sales figures for books/dvds? I guess the chess print market is still much bigger than the digital market, at least from what I see. May change though :-)
malls used to have more bookstores but most have closed in recent years as sales drifted down
many vendors of cd/dvd have also folded
while some vendors remain open, the book and media sector are not what they used to be
given my chess site is fairly popular makes chess books a tad obsolete, been posting some articles on openings lately and might do more games
many vendors of cd/dvd have also folded
while some vendors remain open, the book and media sector are not what they used to be
given my chess site is fairly popular makes chess books a tad obsolete, been posting some articles on openings lately and might do more games
Hi Felix, That really looks good m8
Regards
Tony
Regards
Tony
thanks :-)
Hi saw this post now. Looks so good. But how to do in windows ? no idea about python.
You can install Anaconda (Version 4.4. works well on Windows 10). Then use the pythonw.exe in the installation folder as program to open the script with.
Am having problem with latex one.
What latex i have to use in win 10 to run your script ?
I think I used MikTex, on Linux I use TeXLive.
Just to add that getting LaTeX to run is quite tricky sometimes on Windows
Just to add that getting LaTeX to run is quite tricky sometimes on Windows
I used miktex too. Also texlive full. Now the output of scid can be used on texwork. But even your file am not able to do. So please help me out.
could you post the latex output and does the python script run without errors?
latex output has errors i think. I took your latex file and i had errors.
This is output
LOG FILE :
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7250 64-bit) (preloaded format=pdflatex 2020.2.2) 11 FEB 2020 18:50
entering extended mode
**./pgn2latex_out.tex
(pgn2latex_out.tex
LaTeX2e <2019-10-01> patch level 3
! Undefined control sequence.
l.1 \newgame
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.2 \resetPgnTags
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.10 \gameHeader
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.12 \mainline
[level=1]{1. e4 e5 2. Nf3 d6 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.12 \mainline[
level=1]{1. e4 e5 2. Nf3 d6 }
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
Missing character: There is no [ in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no v in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no = in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no ] in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no . in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no . in font nullfont!
Missing character: There is no N in font nullfont!
Missing character: There is no f in font nullfont!
Missing character: There is no 3 in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no 6 in font nullfont!
Missing character: There is no D in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no P in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no - in font nullfont!
Missing character: There is no V in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no N in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no , in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no a in font nullfont!
LaTeX Font Info: Trying to load font information for +cmr on input line 13.
LaTeX Font Info: No file cmr.fd. on input line 13.
LaTeX Font Warning: Font shape `/cmr/m/n' undefined
(Font) using `/cmr/m/n' instead on input line 13.
! Corrupted NFSS tables.
[email protected] ...message {Corrupted NFSS tables}
[email protected] else let f...
l.13 ...dor-Verteidigung hat den Nachteil, da\~{A}
\"{Y} nicht nur im zweiten...
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
LaTeX Font Warning: Font shape `/cmr/m/n' undefined
(Font) using `OT1/cmr/m/n' instead on input line 13.
Missing character: There is no n in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no m in font nullfont!
Missing character: There is no z in font nullfont!
Missing character: There is no w in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no Z in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no k in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no F in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no w in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no k in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no , in font nullfont!
Missing character: There is no s in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no r in font nullfont!
! Undefined control sequence.
LOG FILE :
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7250 64-bit) (preloaded format=pdflatex 2020.2.2) 11 FEB 2020 18:50
entering extended mode
**./pgn2latex_out.tex
(pgn2latex_out.tex
LaTeX2e <2019-10-01> patch level 3
! Undefined control sequence.
l.1 \newgame
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.2 \resetPgnTags
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.10 \gameHeader
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.12 \mainline
[level=1]{1. e4 e5 2. Nf3 d6 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.12 \mainline[
level=1]{1. e4 e5 2. Nf3 d6 }
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
Missing character: There is no [ in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no v in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no = in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no ] in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no . in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no . in font nullfont!
Missing character: There is no N in font nullfont!
Missing character: There is no f in font nullfont!
Missing character: There is no 3 in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no 6 in font nullfont!
Missing character: There is no D in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no P in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no - in font nullfont!
Missing character: There is no V in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no N in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no , in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no a in font nullfont!
LaTeX Font Info: Trying to load font information for +cmr on input line 13.
LaTeX Font Info: No file cmr.fd. on input line 13.
LaTeX Font Warning: Font shape `/cmr/m/n' undefined
(Font) using `/cmr/m/n' instead on input line 13.
! Corrupted NFSS tables.
[email protected] ...message {Corrupted NFSS tables}
[email protected] else let f...
l.13 ...dor-Verteidigung hat den Nachteil, da\~{A}
\"{Y} nicht nur im zweiten...
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
LaTeX Font Warning: Font shape `/cmr/m/n' undefined
(Font) using `OT1/cmr/m/n' instead on input line 13.
Missing character: There is no n in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no m in font nullfont!
Missing character: There is no z in font nullfont!
Missing character: There is no w in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no Z in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no k in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no F in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no w in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no k in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no t in font nullfont!
Missing character: There is no , in font nullfont!
Missing character: There is no s in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no h in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no r in font nullfont!
! Undefined control sequence.
Attachment: pgn2latex_out.tex - output (5k)
I guess the problem is that you need to execute the other .tex file that comes with my script. This is called pgn2latexENG.tex . The other file contains just the content.
Sorry couldn't get u.
So you did:
1) Execute the pgn2latex3.py script with Python
2) Open the pgn2latexENG.tex file with the latex editor of your choice
?
1) Execute the pgn2latex3.py script with Python
2) Open the pgn2latexENG.tex file with the latex editor of your choice
?
Yes after u asked me i did. And I did get output. But that 3 column one isn't working.
Attachment: pgn2latexENG.pdf - This is my Output (258k)
OK, can you post the Latex output after opening pgn2latexENG.tex? The Latex output you posted seems to be from the pgn2latex_out.tex.
mmh. Is there no error output in that document or does it open the _out.tex when you compile the document? So is the second screenshot what happens when you press the build button?
Find attached my latest version, maybe it fixes it?
Find attached my latest version, maybe it fixes it?
Attachment: pgn2latex2.zip (13k)
>Is there no error output in that document
There is. When i press the quick build there is. Now view pdf leads to "file not found".
>So is the second screenshot what happens when you press the build button?
Its the output of _out.tex
Your new ones i.e. the pgn2latex4.py is not creating the pgn_out file.
Can u generate the pdfs of these?
Attachment: 2020-01GamesSection.pgn (34k)
With which software did you create this pgn with? It contains errors like 26. .. Qg8 .
However, it compiles just fine here.
However, it compiles just fine here.
chessbase and aquarium i use.
but the last one u gave is not creating the pgn_out.tex file of the pgn_in file.
i want the 3 column one desperately.
but the last one u gave is not creating the pgn_out.tex file of the pgn_in file.
i want the 3 column one desperately.
so the last pgn comes directly from chessbase? (the one named 2020-01GamesSection.pgn... you attached)?
yes. most are given by players to our editor of AICCF.
>The Latex output you posted seems to be from the pgn2latex_out.tex.
No....
just to make sure, why isn't it pgn2latexENG.text at the top? Does it switch to pgn2latex_out when compiling?
Could not understand u.
Maybe you can give my online version a try: http://kling.rybkachess.com
Supper awesome. But also give the offline ones. I want to keep myself too.
Why your page is not opening ?
I'm sorry, from time to time the server crashes and I need to reboot manually and somehow the cronjob to start the server doesn't work
Can u add the 3 column style ?
Isn't that the default? Or what do you mean with that?
the file system u provided. I want that the offline one.
ok, here's the latest version of that module file, but I thought it didn't work when you tried the last versions, so I guess this is still not working. note that this is the one used by the webserver, it just returns the tex file when you load it as module (I would have to rewrite it for a new standalone version).
Attachment: pgn2latex7.py.ext (40k)
Am not able to generate from your website. None of the button works
Mmh, it is possible that the server crashed, I restarted it. Could you provide the pgn in case it happens again?
1
2


Powered by mwForum 2.27.4 © 1999-2012 Markus Wichitill