1

I would like to penalize, but not forbid a page break in tcolorbox theorems. Is this possible? MWE:

\documentclass[language=german]{article}

\usepackage{lipsum}
\usepackage[most]{tcolorbox}

\newtcbtheorem{TcbTheorem}{Theorem}{breakable, colback=blue!5, colframe=blue!5, coltitle=red,}{thm}

\begin{document}
    \begin{TcbTheorem}{First}{}
        \lipsum[1-3]
        do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 
    \end{TcbTheorem}
        \begin{TcbTheorem}{Avoid Breaking This}{}
        \lipsum[1]
    \end{TcbTheorem}
    \begin{TcbTheorem}{Break This}{}
        \lipsum
    \end{TcbTheorem}
\end{document}

1 Answer 1

1

Hope this answer is not too late.

Environments defined by \newtcbtheorem accept an optional argument as their first argument, in the form of a list of tcolorbox options. Hence you can specify option unbreakable (or breakable=false) to locally switch the break-ability.

\begin{TcbTheorem}[unbreakable]{Avoid Breaking This}{}
    \lipsum[1]
\end{TcbTheorem}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.