\NewTColorBox 中的 \clearpage 用于新部分

\NewTColorBox 中的 \clearpage 用于新部分
\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 页上的新部分不起作用了吗?有办法让它起作用吗?

相关内容