The snippet below has been obtained nesting two environments taken from amsthm
and tcolorbox
.
I would like to redefine the environment theorem
to produce the same output (I can only modify the preamble).
\documentclass{article}
\usepackage{amsthm}
\usepackage{tcolorbox}
\usepackage{lipsum}
\newtheoremstyle{mystyle}{0ex}{0ex}{}{}{\bfseries}{}{1.5ex}{\llap{\thmnumber{#2}\hskip2mm}\thmname{#1}\thmnote{\bfseries{}#3}}
\theoremstyle{mystyle}
\newtheorem{theorem}{Theorem}
\parindent0pt
\begin{document}
\lipsum[1][1-2]
\begin{tcolorbox}[colback=red!5!white, colframe=red!50!black, extrude left by=5ex, left=5ex, boxsep=0ex]
\begin{theorem}
\lipsum[1][3]
\end{theorem}
\end{tcolorbox}
\lipsum[1][4-5]
\end{document}
\newtcbtheorem
from the tcolorbox package. This way you don't have to nest environments.