Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I put a number beside the chess diagram?

I want to make a document of chess diagrams to be solved and then the solutions at the end. If someone has a skeleton to make this I would be happy.

Thanks in advance!


Thanks for the quick answer.

Is it possible to change the notation numbers of the board to right side? In that case it would be good to have the number to the left (and up) of the diagram. If that is not possible, would it be possible to position the number between where the white or black move mark is. To the right of the diagram. I have several positions in one row like this:

\begin{tabular}{c}

\newgame
\def\myfen{8/8/8/pk6/8/P1K5/1P6/8 b - - 0 1}
\chessboard[tinyboard,setfen=\myfen]

\newgame
\def\myfen{8/8/8/pk6/8/P1K5/1P6/8 b - - 0 1}
\chessboard[tinyboard,setfen=\myfen]

\end{tabular}
share|improve this question
    
I don't understand where you want the numbers, but they can be moved around. See section 4.8. "labels" of the documentation. –  Ulrike Fischer Mar 14 '11 at 17:19
    
Which documentation? I can't see section 4.8 in the pdf's of xskak or skak. –  user4186 Mar 14 '11 at 17:32
    
The documentation of chessboard naturally. –  Ulrike Fischer Mar 14 '11 at 17:47
    
@Chessaddict: Welcome to TeX.SX! The space below the question is for answers i.e. solutions only. If you want to refine your original question please edit it or add comments below the answer(s). I moved the text to the correct place for you, just to keep the site tidy. Note that you can notify people about new comments by adding their username starting with an @. –  Martin Scharrer Mar 14 '11 at 20:04
add comment

1 Answer

Well you can simply use a counter

\documentclass[12pt,a4paper]{article}
\usepackage{xskak}
\newcounter{chessex}
\newcommand\printchessex{\refstepcounter{chessex}\thechessex}
\begin{document}

\chessboard\hfill\printchessex

\chessboard\hfill\printchessex

\end{document}

But I would suggest one of the packages for question/answer sheets, e.g. answers or exams.

share|improve this answer
    
[code] \documentclass[12pt,a4paper]{article} \usepackage{xskak} \newcounter{chessex} \newcommand\printchessex{\refstepcounter{chessex}\thechessex} \begin{document} \chessboard[tinyboard, setfen=k1K b, labelright,labelleft=false,moverstyle=circle,movershift=1em]\printchessex \chessboard[tinyboard, setfen=k1K w, labelright,labelleft=false,moverstyle=circle,movershift=1em]\printchessex \end{document} [\code] The mover and the number clashes. Can I move the number to left-top on the diagram? I would like to reserve space for number 999 so diagrams are aligned nicely when going from ie 9 to 10. –  user4178 Mar 15 '11 at 7:58
    
1. The baseline of the chessboard is at the bottom (think of it as a very large "H"). You can use \raisebox{-\height}{chessboard} to move it down. You can also use `\raisebox{whatever}{...} to move the number up. 2. As mentioned in "4.2 Some words about box sizes" the mover is not necessarly in the bounding box of the board but you can enlarge the right margin to change this. –  Ulrike Fischer Mar 15 '11 at 8:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.