Consider this MWE:
\documentclass[varwidth=3in, multi={my}, crop, ignorerest=true]{standalone}
\usepackage{polyglossia, lipsum, forloop}
\usepackage[most, magazine]{tcolorbox}
\usetikzlibrary{patterns, calc}
\newcounter{loopcntr}
\newcommand{\rpt}[2][1]{%
\forloop{loopcntr}{1}{\value{loopcntr}<#1}{#2}}
\tcbset{
breakable,
break at=3 in,
reset box array,
store to box array
}
\newtcolorbox{mybox}[2][]{%
enhanced,
title=#2,#1}
\newcommand{\xxbody}{%
\lipsum[1-2]%
}
\begin{document}
\begin{mybox}{Heading}
\xxbody{}
\end{mybox}%
\boxarraygetsize{\mysize}
% \rpt[\mysize]{
\rpt[10]{
\begin{my}%
\useboxarray{\theloopcntr}%
\end{my}%
}
\end{document}
If I give a specific count to the \rpt
macro, it works. But produces several blank pages at the end.
To avoid this, if I use \mysize
macro (like in the commented line), it produces an 'Undefined control sequence' error.
What could be the problem? How do I set this right?
\forloop
or\useboxarray
? please post small but complete test document that shows the issue, not fragments\forloop
is from theforloop
package and this is easy. But we cannot know what\useboxarray
,my
and\mysize
are. I see that\useboxarray
is defined bytcolorbox
, but we really need something more to understand what's going on.