关于 voduchoangvu 的问题创建一个彩色盒子?,我也想制作一个如下图所示的框。您也可以使用 tcolorbox 帮助我编写 tex 代码吗?
太感谢了。
答案1
类似这样的事?
\documentclass{article}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\definecolor{myblue}{RGB}{0,163,243}
\newtcolorbox[auto counter,number within=section]{mytheorem}[1][]{
enhanced jigsaw,colback=white,colframe=myblue,coltitle=myblue,
fonttitle=\bfseries\sffamily,
sharp corners,
detach title,
leftrule=22mm,
underlay unbroken and first={\node[below,text=white,font=\sffamily\bfseries,align=center]
at ([xshift=-11mm,yshift=-1mm]interior.north west) {THEOREM\\\thetcbcounter};},
breakable,pad at break=1mm,
#1,
code={\ifdefempty{\tcbtitletext}{}{\tcbset{before upper={\tcbtitle\par\medskip}}}},
}
\begin{document}
\section{Test section}
\begin{mytheorem}[title=Normal Sampling Distributions]
\lipsum[1]
\end{mytheorem}
\begin{mytheorem}
\lipsum[2]
\end{mytheorem}
\begin{mytheorem}[title=Test]
\lipsum[3-5]
\end{mytheorem}
\end{document}