tcolorbox 中断处有较大空间

tcolorbox 中断处有较大空间

考虑一下这个MWE:

\documentclass[varwidth=3in, multi={my}, crop, ignorerest=true]{standalone}
\usepackage{polyglossia, lipsum, forloop}
\usepackage[most, magazine]{tcolorbox}

\newtcolorbox{mybox}[2][]{%
  breakable,
  break at=3 in,
  enhanced,
  height fixed for=all,
  compress page=all,
  pad at break*=0mm,
  enlargepage flexible=2\baselineskip,
  boxrule=2mm,
  bottomrule=16mm,
  overlay app={%
    \node[white, font=\footnotesize, anchor=south, text width=.95\textwidth, text centered, minimum height=16mm] at (frame.south) {Footer1 \\ Footer2};},
  title=#2,#1}

\newcommand{\xxbody}{%
  \lipsum[1-2]%
}

\newcommand{\xxheading}{%
  Heading
}

\begin{document}

\begin{mybox}[reset box array, store to box array]{\LARGE \xxheading{}}

  \xxbody{}

\end{mybox}%


\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 10}%
{%
\begin{my}
  \useboxarray{\thect}
\end{my}
}

\end{document}

我原本以为pad at break*=0mm破损的方框里会塞满文字。但每个破损方框的底部都有很大的空间。

发生了什么事?我该如何解决?

答案1

您的底部规则设置为 16 毫米。只需添加bottomrule at break=2mm 它(不是之前,否则bottomrule将覆盖bottomrule at break)。

\documentclass[varwidth=3in, multi={my}, crop, ignorerest=true]{standalone}
\usepackage{polyglossia, lipsum, forloop}
\usepackage[most, magazine]{tcolorbox}

\newtcolorbox{mybox}[2][]{%
  breakable,
  break at=3 in,
  enhanced,
  height fixed for=all,
  compress page=all,
  pad at break*=0mm,
  enlargepage flexible=2\baselineskip,
  boxrule=2mm,
  bottomrule=16mm,
  bottomrule at break=2mm,
  overlay app={%
    \node[white, font=\footnotesize, anchor=south, text width=.95\textwidth, text centered, minimum height=16mm] at (frame.south) {Footer1 \\ Footer2};},
  title=#2,#1}

\newcommand{\xxbody}{%
  \lipsum[1-2]%
}

\newcommand{\xxheading}{%
  Heading
}

\begin{document}

\begin{mybox}[reset box array, store to box array]{\LARGE \xxheading{}}

  \xxbody{}

\end{mybox}%


\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 10}%
{%
\begin{my}
  \useboxarray{\thect}
\end{my}
}

\end{document}

在此处输入图片描述

相关内容