I created a theorem environment for examples where the content of the examples gets framed but not the heading "Example".
To allow such frames to break across pages I think I should use mdframed
but I cannot get it to work in my predefined command or theorem.
Here is my code showing a framed example which does not break across the page:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{lipsum}
\newtheoremstyle{break} % so the example begins under the heading
{5mm}
{5mm}
{}
{}
{\bfseries}
{}
{\newline}
{}
\theoremstyle{break}
\newtheorem{exmp}{Example}
\newcommand{\example}[1]{%
\begin{exmp}\framebox[\textwidth][l]{#1}%
\end{exmp}}
\begin{document}
\example{\lipsum[2-8]}
\end{document}
To use mdframed inside my example I tried this:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mdframed}
\usepackage{lipsum}
\newtheoremstyle{break} % so the example begins under the heading
{5mm}
{5mm}
{}
{}
{\bfseries}
{}
{\newline}
{}
\theoremstyle{break}
\newtheorem{exmp}{Example}
\newcommand{\example}[1]{%
\begin{exmp}\begin{mdframed}\end{mdframed}%
\end{exmp}}
\begin{document}
\example{\lipsum[2-8]}
\end{document}
\documentclass{...}
and ending with\end{document}
.