This perhaps is not the kind of answer you were expecting. Instead of using the thmbox=M
option (which relies in the thmbox
package) from the thmtools
package , I would suggest you the tcolorbox
package to design a theorem style imitating the one provided by the M
option, but behaving nicely with page breaks:
\documentclass{report}
\usepackage[a6paper]{geometry}% just for the example
\usepackage{amsthm,amsmath}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}
\usepackage{ulem}
\makeatletter
\def\tcb@theo@title#1#2#3{%
\ifdefempty{#2}{\setbox\z@=\hbox{#1}}{\setbox\z@=\hbox{#1~#2}}%
\def\temp@a{#3}%
\ifx\temp@a\@empty\relax%
\unhbox\z@%
\else%
\setbox\z@=\hbox{\unhbox\z@\ }%
\hangindent\wd\z@%
\hangafter=1%
\mbox{\unhbox\z@}(#3)%
\fi%
}
\renewcommand{\newtcbtheorem}[5][]{%
\newtcolorbox[auto counter,#1]{#2}[3][]{#4,%
title={\uline{\tcb@theo@title{#3}{\thetcbcounter}{##2}}},
list entry={\numberline{\thetcbcounter}##2},%
code={\tcb@theo@label{#5}{##3}},%
##1}%
}
\makeatother
\newtcbtheorem{theorem}{Theorem}{
breakable,
enhanced,
arc=0pt,
outer arc=0pt,
coltitle=black,
fonttitle=\bfseries,
fontupper=\itshape,
colback=white,
colframe=white,
left=30pt,
lefttitle=0pt,
boxsep=0pt,
right=0pt,
overlay unbroken={
\draw ([xshift=15pt,yshift=-11pt]frame.north west) -- ([xshift=15pt]frame.south west) |- +(30pt,0);},
overlay first={
\draw ([xshift=15pt,yshift=-11pt]frame.north west) -- ([xshift=15pt]frame.south west);},
overlay middle={
\draw ([xshift=15pt]frame.north west) -- ([xshift=15pt]frame.south west);},
overlay last={
\draw ([xshift=15pt]frame.north west) -- ([xshift=15pt]frame.south west) |- +(30pt,0);},
before=\vspace{2ex}\noindent,
}{the}
\begin{document}
Some cross referecens to theorems~\ref{the:testa} and~\ref{the:testb}
\lipsum[4]
\begin{theorem}{}{testa}
\lipsum[4]\lipsum[4]\lipsum[4]
\end{theorem}
\begin{theorem}{}{testb}
\lipsum[4]
\end{theorem}
\end{document}
