1

I need your help in LaTeX editing:

I want to prepare chess book with tactics. However, I cannot adjust my pages for including text below diagrams. How can I do it? Here the pictures of my idea (edited .jpeg), and my code.

Now:

enter image description here enter image description here

I want like this: enter image description here enter image description here

\documentclass[12pt,a4paper]{book}
\usepackage{xskak}
\usepackage{texmate}
\newcounter{diagrams}
\newcommand\printdiagrams{\refstepcounter{diagrams}\thediagrams}
\begin{document}

\part{Positions}
\chapter{a Deflection and overloading}
\printdiagrams
\chessboard[setfen=6k1/4p3/3p2p1/4brp1/7q/1P2B2P/PP1Q2P1/5RK1 b, showmover=true, moverstyle=triangle, movershift=-1.3ex, moverlift=-1.5ex]\hfill\printdiagrams
\chessboard[setfen=Bn3rk1/p4p1p/b2P2p1/2p1b1B1/3q4/8/P4RPP/2RQ2K1 b, showmover=true, moverstyle=triangle, movershift=-1.3ex, moverlift=-1.5ex]\hfill\printdiagrams
\chessboard[setfen=8/1P6/2n1k3/8/3B1p1p/5P1p/8/5K2 w, showmover=true, moverstyle=triangle, movershift=-1.5ex, moverlift=16.5ex]\hfill\printdiagrams
\chessboard[setfen=6k1/1p1b4/3p4/3Pp3/2Q1P1P1/8/3rBq1R/7K b, showmover=true, moverstyle=triangle, movershift=-1.3ex, moverlift=-1.5ex]\hfill\printdiagrams
\chessboard[setfen=4r3/PB6/1n6/8/5k2/1P3pp1/2R5/5K2 w, showmover=true, moverstyle=triangle, movershift=-1.5ex, moverlift=16.5ex]\hfill

...

\end{document}

With regards, Ulvi Bajarani

4
\documentclass[12pt,a4paper]{book}
\usepackage{xskak}
\usepackage{texmate}
\newcounter{diagrams}
\newcommand\printdiagrams{\refstepcounter{diagrams}\thediagrams}
\setchessboard{showmover=true, moverstyle=triangle, movershift=-1.3ex, moverlift=-1.5ex}
\newcommand\tacticboard[2][]{%
 \noindent\begin{minipage}[t]{0.49\textwidth}
  \centering\printdiagrams\chessboard[#2]\par
   \Large\bfseries #1\strut
    \end{minipage}\hfill\ignorespaces }
\begin{document}

\part{Positions}
\chapter{a Deflection and overloading}
\tacticboard[Find a tactic]{setfen=6k1/4p3/3p2p1/4brp1/7q/1P2B2P/PP1Q2P1/5RK1 b}
\tacticboard[is a move relevant?]{setfen=Bn3rk1/p4p1p/b2P2p1/2p1b1B1/3q4/8/P4RPP/2RQ2K1 b}
 \tacticboard{setfen=8/1P6/2n1k3/8/3B1p1p/5P1p/8/5K2 w,moverlift=16.5ex}
\tacticboard[find a draw]{setfen=6k1/1p1b4/3p4/3Pp3/2Q1P1P1/8/3rBq1R/7K b}
\tacticboard{setfen=4r3/PB6/1n6/8/5k2/1P3pp1/2R5/5K2 w,moverlift=16.5ex} 
...

\end{document}

enter image description here

5
  • Thanks for an answer! But I've a mistake during the compilation: ! File ended while scanning use of \\tacticboard. <inserted text> \par <*> "./Book Start.tex" I suspect you have forgotten a }', causing me to read past where you wanted me to stop. I'll try to recover; but if the error is serious, you'd better type E' or `X' now and fix your file. ! Emergency stop. <*> "./Book Start.tex" *** (job aborted, no legal \end found) Also, I need different formats for both colors (You can see above) Jun 20 '19 at 18:51
  • my code compiles, and I can't know what you did wrong when using it. Regarding the mover: you can naturally move the setting back to the argument. Jun 20 '19 at 19:06
  • The problem was in "[" and "]" symbols, which didn't gave to compile. Jun 20 '19 at 19:28
  • Regarding the mover I've tried, but could not be able to create new command which takes \setchessboard{showmover=true, moverstyle=triangle, movershift=-1.5ex, moverlift=16.5ex} for white to move. How can I write two separate commands (tacticboardwhite and tacticboardblack)? Jun 20 '19 at 20:30
  • 1
    Don't ask follow up questions in comments, I'm the only one getting pinged in such cases. Ask new a question. I correct the mover in my code. Jun 20 '19 at 20:40

Your Answer

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

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