I use the code below to have some fancy boxes.
\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\newcommand{\mytitlegen}{
\node[fill=white,%rounded corners,
draw=white,text=black,line width=3pt,inner sep=4pt,anchor=west,xshift=60pt]
at (frame.north west){\bfseries In title};}
\newtcolorbox{InsideBox}{
drop shadow=black!50!white,enhanced,overlay unbroken and first={\mytitlegen},colframe=black,colback=white,coltitle=black,boxrule=1pt,arc=3mm,%
breakable,top=5pt,before=\vskip18pt,width=0.95\linewidth}
\makeatletter
\newtcolorbox{OutBox}[1][]{%
enhanced,
breakable,
before upper={\parindent15pt},
colback=white,
colframe=gray,
attach boxed title to top right={yshift=-2pt}, title={Out title},
boxed title size=standard,
boxrule=0pt,
boxed title style={%
sharp corners,
rounded corners=northeast,
colback=tcbcolframe,
boxrule=0pt},
sharp corners=north,
overlay unbroken={%
\path[fill=tcbcolback]
([xshift=2pt]title.south west)
to[out=180, in=0] ([xshift=-1.5cm]title.west)--
(title.west-|frame.west) |-
([xshift=2pt]title.south west)--cycle;
\path[fill=tcbcolframe] (title.south west)
to[out=180, in=0] ([xshift=-1.5cm]title.west)--
(title.west-|frame.west)
[rounded corners=\kvtcb@arc] |-
(title.north-|frame.north)
[sharp corners] -| (title.south west);
\draw[line width=.5mm, rounded corners=\kvtcb@arc,
tcbcolframe]
(title.north east) rectangle
(frame.south west);
},
overlay first={%
\path[fill=tcbcolback]
([xshift=2pt]title.south west)
to[out=180, in=0] ([xshift=-1.5cm]title.west)--
(title.west-|frame.west) |-
([xshift=2pt]title.south west)--cycle;
\path[fill=tcbcolframe] (title.south west)
to[out=180, in=0] ([xshift=-1.5cm]title.west)--
(title.west-|frame.west)
[rounded corners=\kvtcb@arc] |-
(title.north-|frame.north)
[sharp corners] -| (title.south west);
\draw[line width=.5mm, rounded corners=\kvtcb@arc,
tcbcolframe]
(frame.south west) |- (title.north) -|
(frame.south east);
},
overlay middle={%
\draw[line width=.5mm, tcbcolframe]
(frame.north west)--(frame.south west)
(frame.north east)--(frame.south east);
},
overlay last={%
\draw[line width=.5mm, rounded corners=\kvtcb@arc,
tcbcolframe]
(frame.north west) |- (frame.south) -|
(frame.north east);
},
#1
}
\makeatother
\begin{document}
\begin{InsideBox}
\lipsum[1-6]
\end{InsideBox}
\begin{OutBox}
\lipsum[1-6]
\end{OutBox}
\end{document}
As you can see, everything is OK.
But, I would like to put the InsideBox in to OutBox. So I tried to write
\begin{OutBox}
\lipsum[1]
\begin{InsideBox}
\lipsum[1-6]
\end{InsideBox}
\end{OutBox}
\lipsum
Then, as you can see, everything is mess up! The InsideBox is not anymore breakable and some text got in OutBox.
What's happening? Thanks in advance!


tcolorboxdocumentation - breakable box inside breakable box is not supported, and in most cases "creates mess." That is what you are experiencing and it is documented state of package. Working around this might be possible, but I dont know how and if even Mr. Sturm doesnt know, you will need someone very proficient in tex or use some kind of hybrid solution. – Tomáš Kruliš May 13 '20 at 12:19InsideBox. – Kώστας Κούδας May 13 '20 at 16:48