0

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.

8
  • your example gives the error ! Package thmtools Error: \declaretheorem key `headfont' not known. Dec 18, 2022 at 16:25
  • most of the other keys you use are also undefined. Have you seen this form used elsewhere, is it using a different theorem package? Dec 18, 2022 at 16:28
  • @DavidCarlisle, These keys are only defined when you load amsthm before thmtools.
    – Udi Fogiel
    Dec 18, 2022 at 22:19
  • @UdiFogiel ah thanks. post as answer? Dec 18, 2022 at 22:45
  • @DavidCarlisle, It does not solve the problem it only remove the errors that you got. It seems there is a bug when using the mdframed and thmbox keys together with the same theorem.
    – Udi Fogiel
    Dec 18, 2022 at 23:00

0

You must log in to answer this question.

Browse other questions tagged .