\documentclass[12pt, a4paper, UTF8, scheme = plain, twoside]{ctexart}
\usepackage{amsmath}
\usepackage{enumerate}
\renewcommand{\labelenumi} {(\roman{enumi})}
\renewcommand{\labelenumii}{(\alph{enumii})}
\usepackage[top=0.5cm,left=0.5cm,right=0.5cm,bottom=2.28cm]{geometry}
\usepackage{hyperref}
\usepackage{graphicx}
\pdfsuppressptexinfo=-1
\usepackage{lipsum}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% - Fancyhdr - %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr}
\usepackage{totpages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tcolorbox}
\tcbuselibrary{skins,xparse,breakable}
\tcbset{%
colback = white,
tikz = {opacity=0.1,transparency group},
colframe = black,
title filled = false,
colbacktitle = white,
}%%
\NewTColorBox[
]{question}{ O{}mo }{
fonttitle = \bfseries,
coltitle = black,
title = #2,
before lower = {\textbf{Solution\quad}},
#1
}%
%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%
%%% DOC Begins %%%
%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\begin{question}
% \lipsum[4]
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
\tcblower
\[
\lambda = 2\times10^5
\qquad
l_0 = 2
\]
% \lipsum[4]
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah \lipsum[4-10]
\end{question}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
为什么breakable
在这种情况下不起作用?
答案1
正如评论中所说,你不应该只是加载breakable
,你必须告诉盒子是否允许加载breakable
。
我注释了tikz = {opacity=0.1,transparency group}
以使您的示例可见,并且我还将 添加{Title}
到您的{question}
环境中。当您创建\NewTColorBox
带有两个参数的 时,第一个是可选的,但第二个似乎不是({question}{ O{}mo }
和title = #2,
)。
接下来是 MWE。
\documentclass[12pt, a4paper, UTF8, scheme = plain, twoside]{ctexart}
\usepackage{amsmath}
\usepackage{enumerate}
\renewcommand{\labelenumi} {(\roman{enumi})}
\renewcommand{\labelenumii}{(\alph{enumii})}
\usepackage[top=0.5cm,left=0.5cm,right=0.5cm,bottom=2.28cm]{geometry}
\usepackage{hyperref}
\usepackage{graphicx}
\pdfsuppressptexinfo=-1
\usepackage{lipsum}
\usepackage{tcolorbox}
\tcbuselibrary{skins,xparse,breakable}
\tcbset{%
colback = white,
%tikz = {opacity=0.1,transparency group},
colframe = black,
title filled = false,
colbacktitle = white,
breakable
}
\NewTColorBox[
]{question}{ O{}mo }{
fonttitle = \bfseries,
coltitle = black,
title = #2,
before lower = {\textbf{Solution\quad}},
breakable,
#1
}
\begin{document}
\thispagestyle{empty}
\begin{question}{Title}
\lipsum[1-3]
\tcblower
\[
\lambda = 2\times10^5
\qquad
l_0 = 2
\]
\lipsum[4-10]
\end{question}
\end{document}