Something like that?
\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}
The skin
library of tcolorbox
has the feature of attached box titles, which can be styled on their own, as well as being shifted with xshift
and yshift
options.
To attach the box title top right, just say attach box title to top right={...}
, with some options, see the manual (version 3.70, as of now, page 131 for more options and possibilities)
\documentclass{article}
\usepackage[most]{tcolorbox}
\newtcbtheorem{Summary}{\bfseries Summary}{enhanced,drop shadow={black!50!white},
coltitle=black,
top=0.3in,
attach boxed title to top right=
{xshift=0em,yshift=-\tcboxedtitleheight/2},
boxed title style={size=small,colback=pink}
}{summary}
\newtcolorbox[auto counter]{summary}[1][]{title={\bfseries Summary~\thetcbcounter},enhanced,drop shadow={black!50!white},
coltitle=black,
top=0.3in,
attach boxed title to top right=
{xshift=0pt},
boxed title style={size=small,colback=pink},#1}
\begin{document}
\begin{Summary}{}{firstsummary}
Brontosaurs are thin at one end, thick in the middle and thin again on the other end
\end{Summary}
\begin{summary}[boxed title style={colback=yellow},colback=green]
Brontosaurs are thin at one end, thick in the middle and thin again on the other end
See excavations of Brontosaurs skeletons
\end{summary}
\end{document}
Here, two versions are shown, own with an overlay of the box title and own with almost no boundary space between bottom of the title box and the top of the regular tcolorbox
frame. In my point of view, the first version does provide the better look.
Best Answer
Improved version:
The result:
First version:
One possibility:
The output:
I used the same style for both examples and assumptions, but if you also want to reproduce the other style, a simple modification will do:
The output: