由于找不到编辑原问题的位置,现将最后我使用的【可行的】代码附在此处。
\newtcbtheorem
[number within=chapter, Crefname={Definition}{Definitions}]
{definition}
{Definition}
{
fonttitle={\bfseries\fontsize{14}{14}\selectfont\color{colorDefinition}},
opacityback=0,
left=.75em,
right=.75em,
top=1.5ex,
bottom=1.2ex,
before skip=10pt plus 1pt minus 1pt,
after skip =14pt plus 1pt minus 1pt,
arc=0pt,
enhanced,
breakable,
boxrule=0pt,
frame hidden,
borderline south={1pt}{0mm}{colorDefinition},
borderline west ={1pt}{0mm}{colorDefinition},
borderline east ={1pt}{0mm}{colorDefinition},
attach boxed title to top left={
yshift=-8pt,
yshifttext=-1mm,
xshift=2em
},
overlay unbroken and first ={
\draw [line width=1pt, color=colorDefinition]
([yshift=-2pt]title.west) -- ++(-2em,0pt);
\draw [line width=1pt, color=colorDefinition]
([yshift=-2pt]title.east) -- +(2em,0pt);
},
boxed title style={
frame style ={fill=none},
interior style={fill=none},
left=.25em,
right=.25em,
top=.25ex,
bottom=.25ex,
height=20pt
}
}
{def}
这里使用了overlay unbroken and first
来处理顶部横线的绘制:unbroken
在框未分页(由于被设置为unbreakable
或者是确实没有分页)的时候绘制,first
在框分页时绘制于第一页。
问 tcolorbox 实现某种特定的边框