\documentclass[11pt]{scrartcl} \usepackage{ntheorem} \usepackage[ style =1 ,linewidth=0,linecolor=blue,backgroundcolor=yellow,margin=0pt,leftmargin=0cm,rightmargin=0cm,xcolor=cmyk] {mdframed} \usepackage { lipsum} \usepackage{showframe} \newtheorem{mdlemma}{Lemma}[section] \newenvironment{lemma}{% \begin{mdframed}[ntheorem=true,margin=10,backgroundcolor=red!30,linecolor=cyan,fontcolor=blue!70!black,linewidth=0,rightmargin=0cm,leftmargin=0cm,roundcorner=5pt,leftmargin=20pt,rightmargin=20pt]% \begin{mdlemma}% }{% \end{mdlemma}% \end{mdframed}% } \begin{document} \begin{mdframed} [skipabove=1cm, outerlinewidth=4pt , middlelinewidth=2pt , innerlinewidth=1pt ,% outerlinecolor=blue , middlelinecolor=yellow , innerlinecolor=red ,% backgroundcolor=orange,roundcorner=10pt] \lipsum[1] \end{mdframed} \begin{lemma}Text \begin{equation} x+y=2 \end{equation} \par\noindent\rule{\linewidth}{2pt} \end{lemma}% \clearpage% \begin{mdframed}% Some Text with an first empy line. The is only text to fill the line. It has no sence. Some Text with an first empy line. The is only text to fill the line. It has no sence. \end{mdframed} \clearpage \section{foo} % % % % % % % % % % % \begin{lemma} % \lipsum[1]\lipsum[1]\lipsum[1] \begin{itemize} \item HALLO \end{itemize} \end{lemma} \begin{lemma} HALLO WELT! \end{lemma} \begin{lemma}\mbox{ }\par\noindent \rule{\linewidth}{4pt} \end{lemma} \begin{mdframed} \rule{\linewidth}{4pt} \end{mdframed} \begin{lemma} \lipsum[5]\lipsum[5] \lipsum[5]\lipsum[5] \end{lemma} \lipsum[1]% \begin{lemma}Text \begin{equation} x+y=2 \end{equation} \par\noindent\rule{\linewidth}{2pt} \end{lemma}% % \begin{lemma}\mbox{ } \begin{equation} x+y=2 \end{equation} \par\noindent\rule{\linewidth}{2pt} \end{lemma} \begin{mdframed}% \lipsum[1]\par\noindent\rule{\linewidth}{2pt} \end{mdframed} \end{document}