0

I am studying chess and decided to take notes. So I am using xskak package. I decided to write in portuguese so that I can share with some friends. The package, however, doesn't obey my command. Here is a piece of working example:

\documentclass{article}
\usepackage{xskak}
    \newskaklanguage{pt}{RDTBCP} %... renames pieces in sequence: KQRBNP
    \skaklanguage[pt]            %... selects language
    \usetextfig                  %... sets text algebra instead of icons
\usepackage{float}

\begin{document}
\section{Abertura italiana}
Também conhecida como abertura \textit{Giuoco Piano}, que em italiano significa abertura tranquila.
Esta abertura, ilustrada na figura~\ref{Abertura italiana}, se caracteriza pela sequência de lances

\styleC
\newchessgame

\mainline{
    1. e4       e5
    }

\noindent
visando dominar o centro do tabuleiro, e

\mainline{
    2. Cf3      Cc6
    3. Bc4
    }

\noindent
visando desenvolver as peças menores.
O lance \variation{3. Bc4} visa atacar o peão mais fraco das pretas \emph{f7}, defendido apenas pelo rei.
As pretas podem responder com \variation{3... Bc5} ou com \variation{3... Cf6}.
A desvantagem do lance \variation{3... Cf6} é que ele bloqueia o avanço do peão \emph{f7}, motivando \variation{4. Cg5} que dá suporte ao bispo aumentando a pressão sobre o peão mais fraco do flanco do rei \emph{f7}.

\begin{figure}[H]
    \centering
    \xskakset{moveid=3w}
    \chessboard[
        setfen          = \xskakget{nextfen},
        showmover       = false,
        %-> SET ARROW:
        style           = warrowstyle,     %-> see def of warrowstyle @ _settings.tex
        markmoves       = {c4-f7},
        style           = barrowstyle,     %-> see def of warrowstyle @ _settings.tex
        markmoves       = {f8-c5},
        pgfstyle        = \rmove,
        markmoves       = {g8-f6},
        %--> SET DESTINY SQUARES:
        % style           = whighlightstyle, %-> see def of whighlightstyle @ _settings.tex
        % colorbackfields = {d5,e4},
        ]
    \caption{Abertura italiana.}
    \label{Abertura italiana}
\end{figure}

\end{document}

Note that althou I wrote in Portuguese 2. Cf3 Cc6, the output presents the algebra in English notation.

Can anyone help me, please? Thank you!

1 Answer 1

1

\skaklanguage sets the input language. To set the output language you must add another declaration (the commands are described in the chessfss documentation, that you can find on ctan).

I'm sorry that the syntax differ, but \skaklanguage is inherited from the skak package.

\documentclass{article}
\usepackage{xskak}
    \newskaklanguage{pt}{RDTBCP} %... renames pieces in sequence: KQRBNP
    \skaklanguage[pt]            %... selects language
    \usetextfig                  %... sets text algebra instead of icons
\settextfigchars[pt]{R}{D}{T}{B}{C}{P}
\begin{document}
\newchessgame
\mainline{ 1. e4 e5 2. Cf3 Cc6}

\settextfiglanguage{pt}
\newchessgame
\mainline{ 1. e4 e5 2. Cf3 Cc6}

\end{document}

enter image description here

1
  • Thank you very much, @UlrikeFischer. It works. And even better: you just showed that I don't need \newskaklanguage at all. I can keep writing the code in English notation and print it in Portuguese just with \settextfigcharts without the optional argument.
    – Brasil
    Feb 5, 2023 at 19:19

You must log in to answer this question.

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