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.

It appears that there are some extremely knowledgeable TeX chess package experts on this site.

I have need to produce nonstandard size chess boards (80 x 80 and larger), densely crowded with hundreds of pieces. Which chess package is best suited for this? The ideal package I have in mind would allow me to specify a board and position in an array style, consisting of rows like this:

 
 P & p & B & N & K &   & \\
 Q &   & k &   & p & b & \\ 

but much larger. Such a format would avoid the need to figure out coordinates for each piece, and also allow more flexibility in making changes to the board, if say, large chunks need to undergo a translation relative to others. But of course, I will be happy with any package capable of producing large boards.

I am using miktex, in case that matters.

share|improve this question
    
Glad you asked this question, since I was looking for something similar to this about 2 weeks ago, only for a modified interpretation using FEN notation. –  Werner Aug 27 '11 at 15:07
    
I think FEN would also be workable for me. –  JDH Aug 27 '11 at 15:42
    
A quick CTAN search wasn't very helpful. You can get the large size boards with the diagram package but the specification of pieces is in German and the notation is clumsy: wKUi{11} means a white king (upside down) on the ith column of the 11th row. –  DJP Aug 27 '11 at 16:21

1 Answer 1

up vote 4 down vote accepted

80x80 is quite large ;-). chessboard allows a maximum of 26 files (files are "numbered" alphabetically and this would be difficult with larger numbers). So with chessboard you would have to use more than one board and glue them together. \chessboard understand FEN, but in this size it is rather slow:

\documentclass{article}

\usepackage{chessboard}
\setchessboard{maxfield=t40,
               boardfontsize=8pt,               
               label=false,
               showmover=false,
               margin=false}
\begin{document}
\lineskip=0pt
\noindent
\chessboard[borderright=false,setfen=k1K3q5r/5pP]%
\chessboard[borderleft=false,setfen=k1K3q5r/5pP]%

\end{document}

If you want something faster and with a more specific input syntax you will have to write parser which translates your P to "PawnOnWhite" and "PawnOnBlack". E.g. along this line (beside key-val command expl3 contains quite a lot other useful command which allows you to parse a token list):

\documentclass{report}
\usepackage{chessfss}
\usepackage{expl3}
\ExplSyntaxOn
\int_new:N \l_rank_int
\keys_define:nn {myboard}
 {P .code:n =
  {
   \int_add:Nn \l_rank_int {1} 
   \int_if_odd:nTF{\l_rank_int}{\WhitePawnOnWhite}{\WhitePawnOnBlack}   
  },
  p .code:n =
  {
   \int_add:Nn \l_rank_int {1}
   \int_if_odd:nTF{\l_rank_int}{\BlackPawnOnWhite}{\BlackPawnOnBlack}
  },  
  %% and so on
 } 
\newcommand\FileOdd[1]{\int_set:Nn\l_rank_int{0}\keys_set:nn{myboard}{#1}}    
\newcommand\FileEven[1]{\int_set:Nn\l_rank_int{1}\keys_set:nn{myboard}{#1}}    
\ExplSyntaxOff
\begin{document}
\lineskip=0pt
\parindent=0pt
\FileOdd{P,P,P,p,p,P,P,P,P}\\
\FileEven{P,P,P,P,p,p,P,P,P}\\
\end{document}
share|improve this answer
    
Thank you very much for your extremely informative answer! I will give things a try and report back later. –  JDH Aug 27 '11 at 16:57
    
It works great! –  JDH Aug 31 '11 at 17:18

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.