我有一个tcolorbox
盒子,里面tcolorbox
还有一个盒子(我想是的),并且我把两个盒子都设置为可破坏的。但是,当盒子内部的文本超过一页时,它们会拒绝转到第二页。基本上,我希望文本转到下一页……当然,仍然在盒子内部。
\documentclass\[12pt\]{amsart}
\usepackage{geometry} % see geometry.pdf on how to lay out the page. There's lots.
\geometry{a4paper} % or letter or a5paper or ... etc
\usepackage{xcolor, colortbl}
\usepackage{marginnote}
\usepackage{tikz}
%%% begin You Try It!%%%%%%%%
\usepackage\[many\]{tcolorbox}
\usetikzlibrary{calc}
%%%%% example
\tcbset{exa/.style={ breakable, enhanced, % outer arc=0pt,
arc=4pt, boxrule=0.0pt, colframe=brown!50!blue, colback=brown!5!white,
attach boxed title to top left, boxed title style={ colback=brown!50!blue,
% outer arc=0pt,
arc=4pt, top=-1pt, bottom=-1pt,
}, fonttitle=\sffamily
}
}
%%
\newtcolorbox\[auto counter\]{sgex}\[1\]\[\]{
exa,
title=Example ~\thetcbcounter,
overlay unbroken and first={
\path
let
\p1=(title.north east),
\p2=(frame.north east)
in
node\[anchor=west,font=\sffamily,color=brown!50!blue,text width=\x2-\x1\]
at (title.east) {#1};
}
}
%%%%%
\definecolor{framerule}{RGB}{183,41,41}
\colorlet{tryit}{green!70!black}
\newcommand\RedBox{\textcolor{framerule}{$\square$}}
\newtcolorbox{eoexample}{
enhanced,
breakable,
toggle left and right,
boxrule=0pt,
colback=white,
arc=0pt,
outer arc=0pt,
top=\topsep,
bottom=\topsep,
left=0pt,
right=0pt,
boxsep=3pt,
overlay unbroken ={%
\node\[draw,tryit,fill=white\]
(tryit)
at (\[xshift=\marginparsep+0.5\marginparwidth\]frame.north east)
{You Try It!};
\draw\[framerule\]
(frame.north west) -- (\[xshift=-3pt\]tryit.west);
\draw\[framerule\]
(\[xshift=3pt\]tryit.east) --
(\[xshift=\marginparsep+\marginparwidth\]frame.north east);
\node\[inner sep=0pt, anchor=east\]
(box)
at (\[xshift=\marginparsep+\marginparwidth\]frame.south east)
{\RedBox};
\draw\[framerule\]
(frame.south west) --
(\[xshift=-3pt\]box.west);
},
overlay first={%
\node\[draw,tryit,fill=white\]
(tryit)
at (\[xshift=\marginparsep+0.5\marginparwidth\]frame.north east)
{You Try It!};
\draw\[framerule\]
(frame.north west) -- (\[xshift=-3pt\]tryit.west);
\draw\[framerule\]
(\[xshift=3pt\]tryit.east) --
(\[xshift=\marginparsep+\marginparwidth\]frame.north east);
},
}
\newtheoremstyle{myexa}% name
{\topsep}%Space above
{\topsep}%Space below
{}%Body font
{}%Indent amount 1
{\bfseries}% Theorem head font
{.}%Punctuation after theorem head
{.5em}%Space after theorem head 2
{}%Theorem head spec
\theoremstyle{myexa}
\newtheorem{exa}{EXAMPLE}
\usepackage{xparse}
\NewDocumentEnvironment{example}{ooO{12}}
{\begin{eoexample}
\begin{sgex}%
\IfNoValueF{#1}{\marginnote{\flushleft{\color{framerule}{#1}}}\[-10mm\]}}%
{\IfNoValueF{#2}{\marginnote{\flushleft{\color{framerule}{#2}}}\[-#3mm\]}%
\end{sgex}\end{eoexample}}
\allowdisplaybreaks
%%%end You Try It!%%%%%%%%%%%%
\usepackage{lipsum}
\begin{document}
\begin{example}\[question\]\[answer\]
\lipsum\[1-6\]
\end{example}
\end{document}