tcolorbox – break box over 2 pages

I have not been using latex for very long and have a question.
Are there any option to break a tcolorbox over 2 pages? Some definitions are too long and I don’t wanna use [tbh].

Code for the definition of the box:

\newtcolorbox[auto counter,number within=chapter,]{myDefinition}[3][]{
arc=5mm,
lower separated=false,
fonttitle=\bfseries,
colbacktitle=blue!10,
coltitle=blue!50!black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
        yshift=-2mm},
colframe=blue!50!black,
colback=blue!10,
overlay={
\node[draw=blue!50!black,thick,
%inner sep=2mm,
fill= blue!10,rounded corners=1mm, 
yshift=0pt, 
xshift=-0.5cm, 
left, 
text=blue!50!black,
anchor=east,
font=\bfseries] 
at (frame.north east) {#3};},
overlay={
\node[draw=blue!50!black,thick,
%inner sep=2mm,
fill= blue!10,rounded corners=1mm, 
yshift=+1.2mm, %hier geaendert
xshift=-0.5cm, 
left, 
text=blue!50!black,
anchor=east,
font=\bfseries] 
at (frame.north east) {#3};},
title=#2 \thetcbcounter,#1}

Code for a example

\begin{myDefinition}[]{Definition}{title}
text
\end{myDefinition}

  • Please don’t post code fragment, instead always make a small, but compilable test document which includes the necessary packages etc.

    – 

You can use the breakable option:

\documentclass{article}

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

\newtcolorbox[auto counter,number within=chapter,]{myDefinition}[3][]{
arc=5mm,
lower separated=false,
fonttitle=\bfseries,
colbacktitle=blue!10,
coltitle=blue!50!black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
        yshift=-2mm},
colframe=blue!50!black,
colback=blue!10,
overlay={
\node[draw=blue!50!black,thick,
%inner sep=2mm,
fill= blue!10,rounded corners=1mm, 
yshift=0pt, 
xshift=-0.5cm, 
left, 
text=blue!50!black,
anchor=east,
font=\bfseries] 
at (frame.north east) {#3};},
overlay={
\node[draw=blue!50!black,thick,
%inner sep=2mm,
fill= blue!10,rounded corners=1mm, 
yshift=+1.2mm, %hier geaendert
xshift=-0.5cm, 
left, 
text=blue!50!black,
anchor=east,
font=\bfseries] 
at (frame.north east) {#3};},
title=#2 \thetcbcounter,#1,breakable}


\begin{document}

\begin{myDefinition}[]{Definition}{title}
\lipsum
\end{myDefinition}


\end{document}

enter image description here

Leave a Comment