在 elegantbook.cls
中扒拉出该盒子的源码,做点小修改即可
\documentclass{ctexart}
\usepackage[most]{tcolorbox}
\usepackage{zhlipsum}
\definecolor{structurecolor}{RGB}{60,113,183}
\tcbset{
introductionsty/.style={
enhanced,
breakable,
colback=structurecolor!10,
colframe=structurecolor,
fonttitle=\bfseries,
colbacktitle=structurecolor,
attach boxed title to top center={yshift=-3mm,yshifttext=-1mm},
boxrule=0pt,
toprule=0.5pt,
bottomrule=0.5pt,
top=8pt,
before skip=8pt,
sharp corners
},
}
\NewDocumentEnvironment{mybox}{O{内容提要}+b}
{
\begin{tcolorbox}[introductionsty,title = {#1}]
#2
\end{tcolorbox}
}
{}
\begin{document}
\begin{mybox}
\zhlipsum[1]
\end{mybox}
\begin{mybox}[这是题目]
\zhlipsum[2]
\end{mybox}
\end{document}
突然发现这样式挺好看的,码了码了
我也觉得,elegantbook 里面的很多元素我都挺喜欢的hhh