![\NewTColorBox 中的 \clearpage 用于新部分](https://linux22.com/image/412868/%5CNewTColorBox%20%E4%B8%AD%E7%9A%84%20%5Cclearpage%20%E7%94%A8%E4%BA%8E%E6%96%B0%E9%83%A8%E5%88%86.png)
\documentclass[12pt,a4paper]{ctexart}
\ctexset{
section={
name={Week},
number={~\arabic{section}}
}
}%
\usepackage{standalone}
\usepackage{amsmath}
\usepackage{fancybox} % fancybox~~~
% Graphicx
\usepackage{graphicx}
\graphicspath{{./figs/}}
%
\usepackage{bookmark}
\usepackage{hyperref}
\hypersetup{
bookmarksopen=false,
pdfstartview= FitH
}
\usepackage[top=1cm,left=1cm,right=1cm,bottom=1cm]{geometry}
\usepackage{tcolorbox}
\tcbuselibrary{skins,xparse}
\tcbset{%
colback=white,
tikz={opacity=0.1,transparency group},
colframe=black,
title filled=false,
% bookmark={Q\arabic{\tcbcounter}}
bookmark={W\thesection\_Q\arabic{\tcbcounter}}
}
%%%%%%%% disable for publishing %%%%%%
\hypersetup{bookmarksdepth=-1}
\NewTColorBox[
auto counter,
number freestyle={ W\noexpand\thesection/Q\noexpand\arabic{\tcbcounter} }
]{question}{ O{}mo }{
lowerbox=ignored, %invisible/ignored
fonttitle=\bfseries,
title=\thetcbcounter: #2,
% after title/after upper
IfValueTF={#3}{after title={\hfill\colorbox{red}{\texttt #3}}}{},
before = \clearpage,
#1
}%
\usepackage{lipsum} % for dummy text only
\begin{document}
\pagestyle{empty}
\setlength{\parindent}{0pt}
%%
\section[Week \thesection]{}
\begin{question}{Tiiiiiiiiitle}[Whatever]
lipsum[4]
\end{question}
\begin{question}{Tiiiiiiiiitle}[Whatever]
lipsum[4]
\end{question}
\begin{question}{Tiiiiiiiiitle}[Whatever]
lipsum[4]
\end{question}
\section[Week \thesection]{}
\begin{question}{Tiiiiiiiiitle}[Whatever]
lipsum[4]
\end{question}
\begin{question}{Tiiiiiiiiitle}[Whatever]
lipsum[4]
\end{question}
\begin{question}{Tiiiiiiiiitle}[Whatever]
lipsum[4]
\end{question}
\end{document}
注意到\clearpage
第 3 页上的新部分不起作用了吗?有办法让它起作用吗?