答案1
请看看答案是否满足您的要求
\documentclass[12pt]{article}
\usepackage[many]{tcolorbox}
\newtcbtheorem[number within=section]{mytheo}{Theorem}{%
colback=white,
colframe=blue!70,
fonttitle=\bfseries,
enhanced,
sharp corners,
coltitle=blue!75!black,
attach boxed title to top left={%
xshift=2ex,
yshift=-4mm,
yshifttext=-1mm},
boxed title style={%
colframe=white,
colback=white}}
{th}
\begin{document}
\begin{mytheo}{This is my title}{theoexample}
This is the text of the theorem. The counter is automatically assigned and,
in this example, prefixed with the section number. This theorem is numbered with
\ref{th:theoexample} and is given on page \pageref{th:theoexample}.
\end{mytheo}
\end{document}