Can we customize \variation command to suppress display of move numbers ? \variation{1. e4} should display e4 (without the move number). Can this be done ?

I should have explained the problem more clearly. I'm talking about the \variation command which is part of xskak package, to display chess moves. I can customize the \variation command using beforenumber, whiteopen, blackopen etc. What ever I do, the final output displays the move number. Also, \variation{e4} is invalid as \variation command expects the move number. So, my question is, can we customize \variation command to not display the move number in the final output (along the lines of beforenumber etc).

Here's an MWE


\newchessgame\mainline{1. e4 e5} \variation{2. Nf3}

\variation{Nf3} is an invalid statement. But I do not want 2. in the output.


3 Answers 3


You can define a \variationNM command in the same vein as \variation:

 \begingroup\catcode`\#=12 \@variationNM}
   \Mainline(#1 Z )%

\newchessgame\mainline{1. e4 e5} \variationNM{Nf3}

enter image description here

  • Yup. Thats exactly what i'm looking for. Thanks.
    – Surya
    Oct 18, 2013 at 19:08

If the usage can be a bit different, there is very simple solution:




\variation11. e4-e5


That gives e4 e4-e5 etc., simply eating the number.

Otherwise the definition is more complicated:


with the usage

\variation{12. e6}
\variation{13. e7}

and the desired result.

  • Although it works, This is not what I'm looking for. I've edited the question which explains the issue I'm facing.
    – Surya
    Oct 18, 2013 at 6:59

@Surya, here is an example:

\title{xskak Dua Kolom}


    \textbf{Botvinnik -- Smyslov} \\
    \textit{World Championship Match (17)} \\
    \textit{Moscow 1957} \\
    Gr\"{u}nfeld Defence


\mainline{1. Nf3 Nf6 2. g3 g6 3. c4 c6 4. Bg2 Bg7 5. Nc3 O-O 6. d4 d5 7. cxd5
cxd5 8. Ne5 b6}
\[ \showboard \]
A satisfactory way of developing.  After {\variation[invar]{8... Nc6 9. Nxc6
bxc6}} Black would be saddled with a weak pawn at c6.

\mainline{9. Bg5 Bb7 10. Bxf6 Bxf6 11. O-O}

In the variation {\variation[invar]{11. e4 dxe4 12. Nxe4 Bxe5 13. dxe5 Nd7
14. f4 Nc5}} Black has a good game.

\mainline{11... e6 12. f4}

If {\variation[invar]{12. e4 Nc6 13. exd5} (\variation[invar]{13. Nxc6 Bxc6
14. exd5 exd5}) \variation[outvar]{13... Nxe5 14. dxe5 Bxe5 15. dxe6 Bxg2 16.
exf7+ Rxf7 17. Kxg2 Bxc3 18. bxc3 Qxd1 19. Rfxd1 Rc8 20. Rd3 Rc4}}, and Black
can successfully battle for a draw in the rook ending.

  • This does not suppress the variation numbers as requested. Jan 28, 2014 at 9:40

You must log in to answer this question.

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