# Package conflict to generate page break: mdframed and exercise

I'm trying to write a text box inside an exercise environment. Unfortunately, this prevents mdframed to break among pages. I want to obtain mdframed to work inside the exercise environment and get page breaks when necessary:

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{mdframed}
\usepackage{lipsum}
\usepackage{exercise}

\begin{document}

\begin{mdframed} % No exercise environment and the box breaks among pages
\lipsum
\end{mdframed}

\begin{Exercise}[title= Exercise title]
\begin{mdframed} % The box does not break among pages
\lipsum
\end{mdframed}
\end{Exercise}

\end{document}

• Welcome to TeX.SX! – Bobyandbob Sep 12 '18 at 10:03
• Imho it can't work. Exercise stores the exercise in a box and unbox is later. Depending on the layout you want to achieve you could look at tcolorbox and its recording commands, see e.g. section 8.3 of its documentation. – Ulrike Fischer Sep 12 '18 at 10:24