First of all, I would like to say that I learned LaTeX by myself, and that my code may not be optimized or I may not master the good practices. Don't hesitate to correct me or to give me advice on this point of view.
I seem to be trying to create a new environment where I can put maths exercises and corrections via Overleaf. I would like these boxes to continue over several pages, even if it means cutting the content into several boxes.
These boxes are quite large; this causes errors in the mdframed package, which cannot cut the content correctly. This leads to an infinite loop and prevents the document from being generated.
The following error is the cause of the interruption: Package mdframed Warning: correct box splittet fails It seems you are using a non splittable contents on input line 335.
Here is a minimal code that produces the error:
\documentclass{exam}
\title {}
\author{}
\date{}
\usepackage[utf8]{inputenc}
\usepackage{tcolorbox}
\usepackage{amthm}
\usepackage{thmtools}
\usepackage{lipsum}
\declaretheoremstyle[
headfont=\bfseries,
notebraces={[}{]},
bodyfont=\normalfont\itshape,
headpunct={},
postheadspace=\newline,
spacebelow=\parsep,
spaceabove=\parsep,
mdframed={
backgroundcolor=red!20,
linecolor=red!30,
innertopmargin=1.5pt,
roundcorner=5pt,
innerbottommargin=3pt,
skipbelow=\parsep,
everyline=true }
]{mytheoremstyle}
\declaretheorem [style=mytheoremstyle, thmbox={style=M, bodystyle=\normalfont,cut=false}, name=algebra exercise]{algebra}
\begin{document}
\begin{algebra}
\lipsum[1-17]
\end{algebra}
\end{document}
I tried to set the cut=true option, but it didn't change my problem.
Thanks for your help and have a nice day.
! Package thmtools Error: \declaretheorem key `headfont' not known.
amsthm
beforethmtools
.mdframed
andthmbox
keys together with the same theorem.