Inserting chess diagrams and games to word

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Inserting chess diagrams and games to word

Post by hgm »

Uri Blass wrote: Fri Nov 18, 2022 4:37 am In the past I copied diagrams to a word document by some site but I did not do it for some years so I do not remember the exact site.

I found the following way to copy diagrams to chess word document without moves

1)Choose a fen for your diagram
for example 3r4/1p5p/p3qp1k/6p1/P3p1P1/Q3N3/5PK1/8 w - - 1 1

2)copy http://www.fen-to-image.com/image/ as the start of you link

3)add the fen so you get
http://www.fen-to-image.com/image/3r4/1 ... 3N3/5PK1/8 w - - 1 1

This link already show me a diagram

4)click on the diagram with the right part of the mouse and choose copy picture with the left part of the mouse(I see the words "copy picture" in hebrew in my computer so I guess that other people see these words in english or a different language that their computer is designed to show)
5)go to a word document and choose ctrl+V that is paste

I get the diagram inside the document in this way with nothing else.
Well, I also have a FEN server on one of my websites (winboard.nl/my-cgi/fen2.cgi). You pass it the FEN as a CGI argument, i.e. behind a ? with several tag=value pairs separated by & behind it. When one of the arguments is f=<FEN>, it outputs a web page with a PNG image of the requested diagram, like:

Image

Other arguments control the appearance. Like w and b for the piece colors, l and d for the square colors (6-digit hex numbers in the RGB system), s for the square size in pixels, t for the set of piece images (currently only xboard and alfaerie are supported for that). With p= instead of f= it would render a single piece in a transparent background.

Image

Another example of a rendered FEN:

Image
The question is if I can get a game inside the document in some way(I would like to be able to see a game from a specific position when I read a document in the same way that I can see it in this forum inside a document that I save in my computer) and of course I prefer a simpler way.
best is simply some software that I insert to it pgn or fen and the software show me directly a picture that I can use copy and paste for it.
chesskobra
Posts: 349
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Inserting chess diagrams and games to word

Post by chesskobra »

I have created some LaTeX examples for typesetting diagrams from FEN using xskak package. https://github.com/hopfmonoid/latex-chess
Collingwood
Posts: 89
Joined: Sat Nov 09, 2019 3:24 pm
Full name: .

Re: Inserting chess diagrams and games to word

Post by Collingwood »

chesskobra wrote: Tue Nov 15, 2022 6:09 pm I think the first part - inserting diagrams - is easy with latex. You can easily convert FEN to a diagram in latex. After that you will have to cut the diagrams and save as png or jpeg, and paste them in word. There may be simpler ways. But instead of all this, I would just go for LaTeX itself.
Should I assume (going by your later post) that you meant specifically xskak?
chesskobra wrote: Fri Nov 18, 2022 1:31 pm I have created some LaTeX examples for typesetting diagrams from FEN using xskak package. https://github.com/hopfmonoid/latex-chess
I haven't looked yet, but thanks.

Do you regard xskak as the best chess macro for LaTeX, or is it just the one you're familiar with?
chesskobra
Posts: 349
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Inserting chess diagrams and games to word

Post by chesskobra »

Collingwood wrote: Wed Dec 28, 2022 6:30 am
chesskobra wrote: Tue Nov 15, 2022 6:09 pm I think the first part - inserting diagrams - is easy with latex. You can easily convert FEN to a diagram in latex. After that you will have to cut the diagrams and save as png or jpeg, and paste them in word. There may be simpler ways. But instead of all this, I would just go for LaTeX itself.
Should I assume (going by your later post) that you meant specifically xskak?
chesskobra wrote: Fri Nov 18, 2022 1:31 pm I have created some LaTeX examples for typesetting diagrams from FEN using xskak package. https://github.com/hopfmonoid/latex-chess
I haven't looked yet, but thanks.

Do you regard xskak as the best chess macro for LaTeX, or is it just the one you're familiar with?
I don't have experience with anything else, and in LaTeX I have not heard of anything else (other than that xskak is an extension of skak). I don't really typeset diagrams or anything chess related, but once I experimented with creating a puzzle collection, and I found xskak to be simple to use, as you can see from the sample on github link I gave. Moreover, if you have an FEN file with 100s of positions, you would be able to generate the latex file with a little script.
Collingwood
Posts: 89
Joined: Sat Nov 09, 2019 3:24 pm
Full name: .

Re: Inserting chess diagrams and games to word

Post by Collingwood »

chesskobra wrote: Thu Dec 29, 2022 9:29 pm
Thanks for your reply. I have a vague memory of some other LaTeX macro, but this was about two decades ago (hence, I don't remember its name, but it was something different), and I don't know how good that was.
chesskobra
Posts: 349
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Inserting chess diagrams and games to word

Post by chesskobra »

Collingwood wrote: Fri Dec 30, 2022 3:09 pm
chesskobra wrote: Thu Dec 29, 2022 9:29 pm
Thanks for your reply. I have a vague memory of some other LaTeX macro, but this was about two decades ago (hence, I don't remember its name, but it was something different), and I don't know how good that was.
I found a few other packages for LaTeX - chessboard (most recent version 2020), texmate, skaknew, chessfss. The most recent versions of the last three are from before 2009. On this page you can see more examples of diagram chasing in LaTeX https://www.overleaf.com/learn/latex/Chess_notation