Code: Select all
\documentclass[10pt,a4paper,twoside]{book}
\usepackage[thref]{ntheorem}
\usepackage{ifthen}
\makeatletter
\newcounter{pl}
\renewtheoremstyle{marginbreak}%
{\stepcounter{pl}\label{pl-\thepl}%
\ifthenelse{\isodd{\pageref{pl-\thepl}}}
{
\item[\rlap{\vbox{\hbox{\theorem@headerfont
\llap{\fbox{##1 ##2}}\hskip\labelsep\relax
\theorem@separator}\hbox{\strut}}}]}
{
\item[\hskip1.7cm\rlap{\vbox{\hbox{\theorem@headerfont
\rlap{\hspace{1.1\textwidth}\fbox{##1 ##2}}\hskip\labelsep\relax
\theorem@separator}\hbox{\strut}}}]\hskip-1.7cm}
}
{\stepcounter{pl}\label{pl-\thepl}%
\ifthenelse{\isodd{\pageref{pl-\thepl}}}
{\item[\rlap{\vbox{\hbox{\theorem@headerfont
\llap{\fbox{##1 ##2}}\hskip\labelsep\relax\
##3\theorem@separator}\hbox{\strut}}}]
}
{\item[\hskip1.7cm\llap{\vbox{\hbox{\theorem@headerfont
\rlap{\hspace{1.1\textwidth}\fbox{##1 ##2}}\hskip\labelsep\relax\
##3\theorem@separator}\hbox{\strut}}}]\hskip-1.7cm%
}
}
\makeatother
\theoremstyle{marginbreak}
\theoremheaderfont{\normalfont\bfseries}\theorembodyfont{\slshape}
\theoremsymbol{\ensuremath{\clubsuit}}
\theoremseparator{:}
\newtheorem{reg}{Ex.}
\begin{document}
text text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text
\begin{reg}[Test 01]\label{t01}
Test example one
\end{reg}
\newpage
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{reg}[Test 02]\label{t02}
Test example two
\end{reg}
\end{document}