1

I found a line "in standard board orientation" but not the option to have a flipped board orientation. Can I have a board displayed for black's view?

1 Answer 1

3

This is more about the chessboard package than xskak. Just put inverse in the options when you invoke \chessboard. Modifying the code from the MWE here we'd have:

\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{5mm}
\usepackage{xskak}
\begin{document}
\begin{preview}
\newchessgame
\mainline{1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6     5. Nc3 a6 6. Be3 e6
7. g4 e5 8. Nf5 g6 9. g5}\\
\chessboard[inverse,label=False]
\end{preview}
\end{document}

The result in Gummi is: enter image description here You can find this in the documentation of the chessboard package here in section 5.2. I've deleted the line \usepackage{chessboard} since the documentation for xskak here says on page 7, "The package xskak uses some primitives of eTEX. It needs version 1.4 or version 1.5 of the package skak , a recent version of the package chessfss (chess font selection) and xkeyval (key=value-syntax), version 1.5 of chessboard (which in turns needs pgf ) and xifthen".

EDIT: This would generate the output on the full page, rather than like a diagram as shown above.

\documentclass[12pt]{article}
\usepackage{xskak}
\begin{document}
\newchessgame
\mainline{1. e4 c5 2. Nf3 d6 3. d4 cxd4 4.  Nxd4 Nf6     5. Nc3 a6 6. Be3 e6
7. g4 e5 8. Nf5 g6 9. g5}
\chessboard[inverse]
\end{document}

The result in Gummi is: enter image description here

Smaller screenshot:

enter image description here

If you don't want the moves, replace mainline moves with \hidemoves{1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e6 7. g4 e5 8. Nf5 g6 9. g5}.

6
  • Nice answer (+1). Any particular reason that you include the code and the empty space around the document in your screenshot?
    – Marijn
    Sep 14, 2020 at 16:07
  • The only reason is I borrowed code from a post using xkak which showed the position from the white perspective so I could change it to a black perspective. I had to revise my answer when I realized \usepackage{chessboard} was included. The \setlength\PreviewBorder{5mm} can also be deleted.
    – DJP
    Sep 14, 2020 at 16:12
  • I wasn't wondering about the code itself (that looks fine as it is), the question was why the result screenshot is not just the chessboard with the game progression, but instead includes also the large gray area around the pdf view, and the editor view with the code in it, I guess that is not really needed for the answer (because the code is already given in the code block above the screenshot), and just the board and the progression would be more clear (same goes for your linked answer).
    – Marijn
    Sep 14, 2020 at 18:21
  • I'm not sure. I posted code to avoid that in my edited post above. Maybe it was due to the tightpage option?
    – DJP
    Sep 14, 2020 at 18:46
  • I have added a smaller screenshot to your post to show what I mean. If you disagree with it you can remove it of course, I thought it would be faster to make an edit than to try to explain it in comments.
    – Marijn
    Sep 14, 2020 at 19:13

You must log in to answer this question.

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