u-fischer / chessboard

15 stars 3 forks source link

rank formating not optimal when setting peculiar boards. #12

Closed Karpeth closed 9 months ago

Karpeth commented 9 months ago

Tamerlane chess and others require some weird things to typeset.

The following is what I use.

\def\timurfile{\ifthenelse{\equal{\value{filelabel}}{12}}{}{\alph{filelabel}}}
\def\nyrank{\hfill\makebox[0pt][r]{\arabic{ranklabel}\hspace{1ex}}}
\chessboard[%hlabelformat=\nyrank,
margin=false,smallboard,vlabelformat=\timurfile,border=false,zero=true,pgfstyle=color,color=white,markregion={Z2-Z8,Z10-Z10, `l4-l10},pgfstyle=border,markregion={Z1-l10},maxfield=m10,printarea={Z1-l10},pgfstyle=bottomlefttopborder,linewidth=0.04em,color=black,markregion={Z9-Z9},pgfstyle=leftborder,markregion={a2-a8},pgfstyle=rightborder,markregion={k3-k9},pgfstyle=toprightbottomborder,markregion={l2-l2},pgfstyle=lefttoprightborder,markregion={a10-k10},pgfstyle=rightbottomleftborder,markregion={a1-k1},pgfstyle=toprightbottomborder,markregion={l2-l2},showmover=false,%addpieces={Ea1,Ek1,ea10,ek10,Ra2,Rk2,ra9,rk9,Nb2,Nj2,nb9,nj9,Fe2,Kf2,Vg2,fg9,kf9,ve9,Gd2,Gh2,gd9,gh9,Cc1,Ci1,cc10,ci10,De1,Dg1,de10,dg10,Hc2,Hi2,hc9,hi9,Ia3,ik8,Jb3,jj8,Lc3,li8,Od3,oh8,Se3,sg8,Tf3,tf8,Ug3,ue8,Wh3,wd8,Xi3,xc8,Yj3,yb8,Zk3,za8}
]`
\end{minipage}\begin{minipage}[t][][b]{.5\textwidth}

without nyrank, the ranks gets overwritten by a blank white square. timurfile (and others in the project) surpresses the letters at 0 and the final square.

It would be nice not to work around the package. :)

u-fischer commented 9 months ago

You have a very short memory: https://github.com/u-fischer/chessboard/issues/11#issuecomment-1934143627 I'm closing this as unclear.

Karpeth commented 9 months ago

I am sorry.

Here including my code, with the preamble.

\documentclass[titlepage,a4paper,oneside]{report}
\usepackage{chessboard}
\begin{document}
\def\timurfile{\ifthenelse{\equal{\value{filelabel}}{12}}{}{\alph{filelabel}}}
\def\nyrank{\hfill\makebox[0pt][r]{\arabic{ranklabel}\hspace{1ex}}}
\chessboard[%hlabelformat=\nyrank,
margin=false,smallboard,vlabelformat=\timurfile,border=false,zero=true,pgfstyle=color,color=white,markregion={Z2-Z8,Z10-Z10, l4-l10},pgfstyle=border,markregion={Z1-l10},maxfield=m10,printarea={Z1-l10},pgfstyle=bottomlefttopborder,linewidth=0.04em,color=black,markregion={Z9-Z9},pgfstyle=leftborder,markregion={a2-a8},pgfstyle=rightborder,markregion={k3-k9},pgfstyle=toprightbottomborder,markregion={l2-l2},pgfstyle=lefttoprightborder,markregion={a10-k10},pgfstyle=rightbottomleftborder,markregion={a1-k1},pgfstyle=toprightbottomborder,markregion={l2-l2},showmover=false,%addpieces={Ea1,Ek1,ea10,ek10,Ra2,Rk2,ra9,rk9,Nb2,Nj2,nb9,nj9,Fe2,Kf2,Vg2,fg9,kf9,ve9,Gd2,Gh2,gd9,gh9,Cc1,Ci1,cc10,ci10,De1,Dg1,de10,dg10,Hc2,Hi2,hc9,hi9,Ia3,ik8,Jb3,jj8,Lc3,li8,Od3,oh8,Se3,sg8,Tf3,tf8,Ug3,ue8,Wh3,wd8,Xi3,xc8,Yj3,yb8,Zk3,za8}
]
\end{document}

ranks above 10 will not play nice unless the alignment is changed, as with nyrank.

u-fischer commented 9 months ago

It would be nice not to work around the package

You are not working around the package. The default settings are for normal 8x8 chessboards. If you setup a weird board you have to adapt the settings, and the keys hlabelformat and vlabelformat etc are provided for this.