I have an environment created with tcolorbox
where the upper part is in bold text, and the lower part is not. Sometimes I use \tcbsubtitle
inside this environment, and I would like that to correspond to the separation of the upper and lower part. If I do not use \tcbsubtitle
, then \tcblower
adds the correct amount of space, but if I use \tcbsubtitle
in addition, the space becomes too much.
I realize that the purpose of \tcbsubtitle
is not to start the lower part of the box, but since the only difference between the upper and the lower part is the font weight, I thought I could get \tcbsubtitle
to change the font following it. I did try the following without success:
\tcbset{
subtitle style = {after = {\normalfont}}
}
Here is a minimal working example:
\documentclass{article}
\usepackage[most]{tcolorbox}
\newtcbtheorem{example}{Example}{
middle = 1em,
lower separated = false,
fontupper = \bfseries\boldmath\raggedright,
fontlower = \raggedright,
fonttitle = \bfseries\boldmath\raggedright,
}{ex}
\begin{document}
\begin{example}{}{}
Bold text
\tcblower % Appropriate amount of vertical space
Normal text
\end{example}
\begin{example}{}{}
Bold text
\tcblower % Too much space
\tcbsubtitle{Subtitle}
Normal text
\end{example}
\begin{example}{}{}
Bold text
\tcbsubtitle{Subtitle} % Appropriate amount of vertical space
Bold text % Still bold
\end{example}
\end{document}