This uses a 'tricky' overlay approach, setting explicitly another tcolorbox
as the box title for the broken parts of the box.
The extras middle and last=
option is meant to add features to the 'middle' and 'last' box parts, i.e. the ones after breaking the box.
\documentclass{article}
\usepackage{lipsum}%
\usepackage[all]{tcolorbox}%
\begin{document}
\def\TheTitle{Boxed title}
\tcbset{boxtitlestuff/.style={boxrule=0.4pt,colback=black!2!white,coltitle=black,fonttitle={\bfseries},size=normal},
brokentitle/.style={geometry nodes=true,skin=freelancemiddle,
extras middle and last={overlay={\node[above,inner sep=-4pt] (A) at (interior.north) {\tcbox[boxtitlestuff]{continued \TheTitle}};}
}
}
}
\begin{tcolorbox}[skin=enhanced jigsaw,
breakable,
attach boxed title to top center={yshift=-2mm},
coltitle=black,
boxed title style={boxrule=0.4pt,colback=black!2!white},
title=\TheTitle,
% title after break={continued \TheTitle},
brokentitle
]
\lipsum
\lipsum
\lipsum
\lipsum
\end{tcolorbox}
\end{document}
Probably there's a much more elegant tcolorbox
solution, but you could always 'freelance' the frame as well:
\documentclass{article}
\usepackage{lipsum}
\usepackage[skins,breakable]{tcolorbox}
\begin{document}
% Example taken from Thomas F. Sturm Manual for version 3.93 p. 346
% Problem: After a break, The style of the boxed title is lost
% Christian Hupfer found a solution that keeps the style of the boxed title after a break in a tcolorbox.
% http://tex.stackexchange.com/questions/315091/tcolorbox-same-boxed-title-style-after-break
% The solution works well for frames made of a continuous line.
% Is there a way to make it work for dashed frames ?
\tcbset{%
boxtitlestuff/.style={%
frame empty,
colback=black!2!white,
},
brokentitle/.style={%
geometry nodes=true,
skin=freelance,
extras first={%
overlay={%
\draw [preaction={draw=green!15!white, line width=1pt, rounded corners}, rounded corners, green!50!white, line width=1pt, dashed] ([yshift=1pt, xshift=-1pt]interior.north west) rectangle ([yshift=-1pt, xshift=1pt]interior.south east);
\node[above, rounded corners, draw, green!50!white, line width=1pt, fill=green!15!white, text=green!50!black, font=\bfseries\normalsize] (A) at ([yshift=-.25\baselineskip]interior.north) {#1};
}
},
extras middle and last={%
overlay={%
\draw [preaction={draw=green!15!white, line width=1pt, rounded corners}, rounded corners,green!50!white, line width=1pt, dashed] ([yshift=1pt, xshift=-1pt]interior.north west) rectangle ([yshift=-1pt, xshift=1pt]interior.south east);
\node[above, rounded corners, draw=black, line width=.8pt, fill=black!2!white, text=black, font=\bfseries\normalsize] (A) at ([yshift=-.25\baselineskip]interior.north) {continued boxed title};
}
}
}
}
\begin{tcolorbox}[%
brokentitle=Boxed title,
breakable,
frame empty,
colframe=green!15!white,
]
\tiny
\lipsum
\lipsum
\end{tcolorbox}
\end{document}
Best Answer
As a work around, you can put the title in a
\parbox
of the relevant size: