1

If I have a theorem or lemma or example, I want it to be split in two rows and not run into the margin and of the page. How can I achieve that?

MWE

\documentclass{article}
\usepackage{framed,amsmath,tikz}
\usepackage[thmmarks,framed,thref,hyperref,amsmath]{ntheorem}

%lemma
\theoremstyle{break}
\theoremprework{%
\def\FrameCommand{
{\color{blue}{\hspace{-8pt}\vrule width 2pt \hspace{6pt}}}}
\medbreak}
\theorempostwork{\medbreak}
\theorembodyfont{\itshape}
\theoremheaderfont{\kern-5mm\normalfont\bfseries} 
\theoremindent0.5cm
\newframedtheorem{lemma}{Lemma}[subsection]


\begin{document}
\begin{lemma}[Das Aufzählungslemma mit einem langen Titel, der eigentlich nicht in die Margin gehen soll]
Ein Lemma 
\begin{enumerate}
    \item
    in

    \item
    mehreren

    \item
    Teilen.
\end{enumerate}
\end{lemma}
\end{document}

1 Answers1

2

ntheorem typesets the theorem note in a single box, which is unbreakable.

You can use amsthm and mdframed.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mdframed}
\usepackage{amsthm}

\newtheoremstyle{break}
  {\topsep}
  {\topsep}
  {\itshape}
  {0pt}
  {\bfseries}
  {.}
  {\newline}
  {\thmname{#1}\thmnumber{ #2}\thmnote{ \textbf{(#3)}}}

\theoremstyle{break}
\newmdtheoremenv[
  linecolor=blue,
  linewidth=2pt,
  topline=false,rightline=false,bottomline=false,
  innertopmargin=0pt,
  innerbottommargin=10pt,
  innerrightmargin=0pt,
]{lemma}{Lemma}[subsection]



\begin{document}

\begin{lemma}[Das Aufzählungslemma mit einem langen Titel, der 
  eigentlich nicht in die Margin gehen soll]
Ein Lemma 
\begin{enumerate}
  \item in

  \item mehreren

  \item Teilen.
\end{enumerate}
\end{lemma}

\end{document}

enter image description here

egreg
  • 1,121,712