通过多列处理列分隔符中的命令元素

通过多列处理列分隔符中的命令元素

我尝试将包含标题的棋盘图页面分成两个不同的列。问题是命令元素没有一起处理。例如,在其中一个页面中,标题在另一个页面中,而图表和符号在另一个页面中:

有问题的页面 1有问题的页面 2

另外,我提供了简化的代码:

\documentclass[paper=7in:10in,DIV=calc,12pt]{scrbook}
\usepackage[inner=0.5in, outer=0.25in]{geometry}
\usepackage{pdfpages}

\usepackage{xskak}
\usepackage{texmate}
\usepackage{array}
\usepackage{amssymb}

\usepackage{multicol}
\setlength{\columnseprule}{0.5pt}
\def\columnseprulecolor{\color{black}}

\setcounter{secnumdepth}{55}
\setcounter{tocdepth}{55}

\addtokomafont{section}{\centering}

\newcounter{diagramsforinstruction}
\newcommand\printdiagramsforinstruction{\small\refstepcounter{diagramsforinstruction}\thediagramsforinstruction}

\newcommand\introductionboard[3][]{%
\setchessboard{showmover=true, moverstyle=triangle, boardfontsize=20pt}
 \bgroup\medskip\par\large\bfseries #1
  \centering\par\makebox[1em][l]{\printdiagramsforinstruction}\chessboard[#2]\par\egroup\bgroup\centering\small #3\par\medskip\egroup\vfill\null\columnbreak}

\begin{document}

\begin{multicols}{2}

\introductionboard[Timofeev vs Dimitrijevic 2004]{setfen=1r1qn1k1/1r1b1pb1/3pp1p1/3N2P1/p2NP3/5P2/1PP4Q/1KBR3R w}{Here, White managed to mate Black after \textbf{26. Qh7+ Kf8 27. Qh8+! Bxh8 28. Rxh8+ Kg7 29. Rdh1} and Black resigned due to the threat Rh1-h7\#.}
\introductionboard[Hlousek vs Novak, 1970, Solingen, match (6)]{setfen=3qb1k1/1n1r2pp/3p1p2/1pnPpN2/2p1P1P1/2P1B2P/QPB2P2/4R1K1 w}{Here, White managed to enter to the opponent's position after \textbf{28. Ra1 Rc7 29. Qa8} (changing the defender) \textbf{29...Qxa8 30. Rxa8 Kf8 31. Nxg7!} The tactical shot. \textbf{31...Rxg7} (if 31...Kg7 then 32.Re8\WBetter) \textbf{32. Bh6\WBetter} \ Black resigned.}
\introductionboard[Timofeev vs Dimitrijevic 2004]{setfen=1r1qn1k1/1r1b1pb1/3pp1p1/3N2P1/p2NP3/5P2/1PP4Q/1KBR3R w}{Here, White managed to mate Black after \textbf{26. Qh7+ Kf8 27. Qh8+! Bxh8 28. Rxh8+ Kg7 29. Rdh1} and Black resigned due to the threat Rh1-h7\#.}
\introductionboard[Hlousek vs Novak, 1970, Solingen, match (6)]{setfen=3qb1k1/1n1r2pp/3p1p2/1pnPpN2/2p1P1P1/2P1B2P/QPB2P2/4R1K1 w}{Here, White managed to enter to the opponent's position after \textbf{28. Ra1 Rc7 29. Qa8} (changing the defender) \textbf{29...Qxa8 30. Rxa8 Kf8 31. Nxg7!} The tactical shot. \textbf{31...Rxg7} (if 31...Kg7 then 32.Re8\WBetter) \textbf{32. Bh6\WBetter} \ Black resigned.}
\introductionboard[Timofeev vs Dimitrijevic 2004]{setfen=1r1qn1k1/1r1b1pb1/3pp1p1/3N2P1/p2NP3/5P2/1PP4Q/1KBR3R w}{Here, White managed to mate Black after \textbf{26. Qh7+ Kf8 27. Qh8+! Bxh8 28. Rxh8+ Kg7 29. Rdh1} and Black resigned due to the threat Rh1-h7\#.}
\introductionboard[Hlousek vs Novak, 1970, Solingen, match (6)]{setfen=3qb1k1/1n1r2pp/3p1p2/1pnPpN2/2p1P1P1/2P1B2P/QPB2P2/4R1K1 w}{Here, White managed to enter to the opponent's position after \textbf{28. Ra1 Rc7 29. Qa8} (changing the defender) \textbf{29...Qxa8 30. Rxa8 Kf8 31. Nxg7!} The tactical shot. \textbf{31...Rxg7} (if 31...Kg7 then 32.Re8\WBetter) \textbf{32. Bh6\WBetter} \ Black resigned.}

\end{multicols}
\end{document}

问题是:

我应该如何更改代码\介绍板以便命令的所有元素都可以一起处理并且适合一列?

答案1

可能的答案是使用 \begin{minipage} 作为 \introductionboard 命令:

\newcommand\introductionboard[3][]{%
\begin{minipage}{0.44\textwidth}
\setchessboard{showmover=true, moverstyle=triangle, boardfontsize=20pt}
 \bgroup\medskip\par\large\bfseries #1
  \centering\par\makebox[0.5em][l]{\printdiagramsforinstruction}\chessboard[#2]\par\egroup\bgroup\centering\small #3\par\medskip\egroup
  \vfill\null\columnbreak\end{minipage}}

相关内容