0

The problem is when number of diagrams switches from 9 to 10, or from 99 to 100, or 999 to 1000 etc., the diagram alignment becomes slightly inaccurate (has shown in the picture with red arrows):Exception from latex code

What is a reason of such behaviour? How it might be solved?

Here, is the code (counter is "diagram"):

\documentclass[paper=8.27in:11.69in]{scrartcl}
\usepackage[total={8.27in,11.69in}, top=1in, bottom=1in, left=0.375in, right=0.375in]{geometry}
\usepackage{pdfpages}
\usepackage{xskak}
\usepackage{texmate}
\usepackage{array}
\usepackage{fdsymbol}
\addtokomafont{section}{\centering}
\pagenumbering{gobble}
\newcounter{diagrams}
\newcommand\printdiagrams{\refstepcounter{diagrams}\thediagrams}
\setboardfontfamily{merida}
\setchessboard{showmover=true, moverstyle=triangle}
\newcommand\tacticboard[3][]{%
 \noindent\begin{minipage}[t]{0.49\textwidth}
  \vfill\centering\bfseries #1\strut
   \par\printdiagrams\chessboard[#2]\par
    \Large\bfseries #3\bigskip
     \end{minipage}\hfill\ignorespaces}
\newcommand\introductionboard[3][]{%
 \bgroup\medskip\par\Large\bfseries #1
  \centering\par\printdiagrams\chessboard[#2]\par\egroup\bgroup\centering\large\bfseries #3\par\medskip\egroup}

\begin{document}
\section*{a Deflection and overloading}

\introductionboard[x-y]{setfen=8/8/2P2k2/B2Kb3/5p2/8/8/8 w}{1. Bc3! Bc3 2. c7\WBetter 1. Bc3! Bc3 2. c7\WBetter1. Bc3! Bc3 2. c7\WBetter1. Bc3! Bc3 2. c7\WBetter}aofkoewgiowjigjwijoioroirw
\introductionboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{1...Nb6! 2. Nxb6 c3\BBetter}
\introductionboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{1...Nb6! 2. Nxb6 c3\BBetter}
\introductionboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{1...Nb6! 2. Nxb6 c3\BBetter}\introductionboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{1...Nb6! 2. Nxb6 c3\BBetter}\introductionboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{1...Nb6! 2. Nxb6 c3\BBetter}
\raggedright
1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter1...Nb6! 2. Nxb6 c3\BBetter



\newpage
\section*{Positions}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{s}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{o}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{}
\tacticboard[x-y]{setfen=8/6p1/8/3n3P/N1pk2KP/P7/8/8 b}{}


\end{document}
  • 1
    well naturally \printdiagrams is larger if the number is larger. Use e.g. \makebox[1cm][l]{\printdiagrams} – Ulrike Fischer Dec 7 '19 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.