希望你们一切都好!我在我的一个文件中使用过这个颜色框,但我对其进行了编辑,以便可以通过添加覆盖键来破坏它,无论如何,这是我的代码和编译后的结果:
\documentclass{article}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}
\newtcolorbox[auto counter]{exo}[1][]{%
enhanced, breakable, fonttitle=\large\bfseries,
title=\raisebox{-2pt}{\textcolor{blue}{E}},
left=\tcboxedtitlewidth,
boxsep=0pt, top=2mm, right=2mm, bottom=2mm+0.7\baselineskip,
sharp corners, colback=white, colbacktitle=blue, frame hidden, opacityback=.5,
pad before break=-0.7\baselineskip,
before upper = {\begingroup
\large\bfseries\textcolor{blue}{xercice }
\textcolor{red}{\thetcbcounter} \quad\endgroup},
attach boxed title to top left={
xshift=2pt,
yshift=-\tcboxedtitleheight+1.5pt-2mm},
boxed title style={
empty, left=0mm, right=0mm, top=0mm, bottom=0mm, boxsep=2pt},
underlay boxed title={
\path[fill=red] (title) circle (\tcboxedtitleheight/2);},
overlay unbroken={
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=-\tcboxedtitleheight-0.7\baselineskip] (nw) at (frame.north west);
\node (sw) [circle, fill=red, inner sep=2pt,
xshift=\tcboxedtitlewidth/2, yshift=\tcboxedtitlewidth/2]
at (frame.south west) {};
\draw[blue, line cap=round, line width=2pt,
dash pattern=on 0pt off 4\pgflinewidth] (nw) -- (sw);},
overlay first={
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=-\tcboxedtitleheight-0.7\baselineskip] (nw) at (frame.north west);
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=0.7\baselineskip] (sw) at (frame.south west);
\draw[blue, line cap=round, line width=2pt,
dash pattern=on 0pt off 4\pgflinewidth] (nw) -- (sw);}
overlay last = {
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=-\tcboxedtitleheight-0.7\baselineskip] (nw) at (frame.north west);
\node (sw) [circle, fill=red, inner sep=2pt,
xshift=\tcboxedtitlewidth/2, yshift=\tcboxedtitlewidth/2]
at (frame.south west) {};
\draw[blue, line cap=round, line width=2pt,
dash pattern=on 0pt off 4\pgflinewidth] (nw) -- (sw);
} ,#1}
\begin{document}
\vspace*{12cm}
\begin{exo}
\lipsum[1]
\lipsum[2]
\end{exo}
\end{document}
如上图所示,盒子的第二部分没有按照我想要的方式框起来。有什么想法或思路可以解决这个问题吗?提前谢谢!