1

I am using the skak package to print chess games with some success. I would like to ask if it is possible to output the moves, changing the names of the squares to another language. For example, for the greek language I would like to apply the following transformation:

a --> α, b --> β, c--> γ, d--> δ, e--> ε, f--> ζ, g--> η, h--> θ.

If this is not a feature of skak, perhaps there is also another way that latex (or xelatex, which is what I am using) can do the above replacement for some part of a document.

6

1 Answer 1

2

It's funny, even though skak was built with support for various input languages, this support only extends to the names of chess pieces, not files (i.e., column names).

For a start, try the following. I used babel for greek, but it would have been the same with, say, xelatex. (Change log: 0. Basic translation; 1. Fixed captures and ambiguous moves.).

\documentclass[12pt]{article}
\usepackage[greek]{babel}
\usepackage{skak}
\makeatletter
\def\TranslateFile#1%
 {\EqStr{#1}{a}{a}
 {\EqStr{#1}{b}{b}
 {\EqStr{#1}{c}{g}
 {\EqStr{#1}{d}{d}
 {\EqStr{#1}{e}{e}
 {\EqStr{#1}{f}{z}
 {\EqStr{#1}{g}{h}
 {\EqStr{#1}{h}{j}{}}}}}}}}}
\def\printmove@san{%
  \EqPiece{Z}{\PieceNameToMove}%
  {\Castling%
    {\LongCastling{\castlingchar\castlinghyphen}{}%
      \castlingchar\castlinghyphen\castlingchar}%
    {%pawn move
      \Capture{\TranslateFile{\FileDiscriminator}\capturesymbol}{}%
      \TranslateFile{\MoveToFile}\MoveToRank%
      \Promotion{\cfss@textsymfigsymbol{\PromotionPieceName}}{}}}%
  {% piece move
    \cfss@textsymfigsymbol{\PieceNameToMove}%
    \EqStr{Z}{\FileDiscriminator}{}{\TranslateFile{\FileDiscriminator}}%
    \EqStr{Z}{\RankDiscriminator}{}{\RankDiscriminator}%
    \Capture{\capturesymbol}{}%
    \TranslateFile{\MoveToFile}\MoveToRank}%
  % for all moves:
  \CheckTest\MateTest\MoveRest}
\shortmoves
\makeatother
\begin{document}
\newgame
\mainline{1.e4 e5 2.Nf3 Nc6 3.Bb5}
\par\newgame
\mainline{1.c4 d5 2.cxd5}
\par\newgame
\mainline{1.d4 Nf6 2.Nf3 e6 3.Nfd2}
\end{document}

moves in greek

It may not be enough for typesetting all possible games that you have in mind, as my chess is a bit rusty and I cannot predict what the issues will be. Feel free to reply with comments, if something does not work, and I'll try to fix it. Καλές παρτίδες... :-)

4
  • Thank you very much. I need one final touch, because in your solution, pawn captures are not fully translated: e.g. if you change the mainline to 1.e4 d5 2.exd5, the second move is typeset as 2.exδ5, instead of 2.εxδ5. (Basically, I think that every time a small letter is encountered in a move, you could change it to a greek letter, because chess notation uses capital letters for pieces -- but I could be wrong) Oct 14, 2013 at 3:07
  • ... and now that I think about it again, also ambiguous moves: 1.d4 Nf6 2.Nf3 e6 3.Nbd2 Oct 14, 2013 at 3:49
  • lol, this is not the first time you are helping me with LaTeX ... I see in your profile that you have also helped me with some issues while typesetting my diploma thesis four years ago. Oct 14, 2013 at 4:39
  • I just fixed captures and ambiguous moves. Cheers...
    – nickie
    Oct 14, 2013 at 7:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .