答案1
由于您没有提供没有加固角的盒子的代码,因此我不得不使用一些代码作为起点。我使用这个。然而,新成分
overlay={\draw[ultra thick]
([yshift=-1em]frame.north west) |- ([xshift=1em]frame.north west)
([yshift=-1em]frame.north east) |- ([xshift=-1em]frame.north east)
([yshift=1em]frame.south west) |- ([xshift=1em]frame.south west)
([yshift=1em]frame.south east) |- ([xshift=-1em]frame.south east)
;}
只要你加载相关的库,它就可以与任何盒子代码一起工作。
\documentclass[12pt]{article}
\usepackage[many]{tcolorbox}
\usepackage[%
margin=2cm,
includefoot,
bottom=2.55cm,
top=2.025cm,
headsep=0.5cm,
footskip=0.65cm
]{geometry}
\definecolor{myblue}{RGB}{0,46,142}
\newtcolorbox[auto counter]{mytheorem}[1][]{%
enhanced jigsaw,
colback=white,
colframe=myblue,
coltitle=myblue,
fonttitle=\bfseries,
sharp corners,
detach title,
enlarge left by=18mm,
width=\linewidth-18mm,
underlay unbroken and first={%
\node[above,text=myblue,font=\bfseries,align=center] at ([xshift=-.5\textwidth,yshift=-7mm]interior.north) {\thetcbcounter};
},
breakable,
pad at break=1mm,
#1,
code={\ifdefempty{\tcbtitletext}{}{\tcbset{before upper={\tcbtitle\par\medskip}}}},
overlay={\draw[ultra thick]
([yshift=-1em]frame.north west) |- ([xshift=1em]frame.north west)
([yshift=-1em]frame.north east) |- ([xshift=-1em]frame.north east)
([yshift=1em]frame.south west) |- ([xshift=1em]frame.south west)
([yshift=1em]frame.south east) |- ([xshift=-1em]frame.south east)
;}
}
\begin{document}\raggedright
\begin{mytheorem}[title=Important Note]
Important content. A body remains in a state of rest or continuous uniform motion unless acted on by an unbalanced external force.
\begin{align*}
45x^2-4x & =75x
\end{align*}
\end{mytheorem}
\end{document}