I think my problem might be really basic, but I went through the documentation and could not figure out how to force text to wrap inside a tcolorbox title, when the title is too long.
\documentclass[a4paper,11pt]{book}
\usepackage{lipsum}
\usepackage{amsmath,amssymb}
\usepackage[most]{tcolorbox}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern}
\tcbset{
thmbox/.style={
enhanced,
breakable,
sharp corners=all,
fonttitle=\bfseries\normalsize,
fontupper=\normalsize\itshape,
top=0mm,
bottom=0mm,
right=0mm,
colback=white,
colframe=white,
colbacktitle=white,
coltitle=black,
attach boxed title to top left,
boxed title style={empty, size=minimal, bottom=1.5mm},
overlay unbroken ={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)|-%
(frame.south east)--(frame.north east);},
overlay first={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)-- ([xshift=3.5mm]frame.south west);
\draw (frame.north east)--(frame.south east);},
overlay middle={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);
\draw (frame.north east)--(frame.south east);},
overlay last={
\draw ([xshift=3.5mm]frame.north west)|-%
(frame.south east)--(frame.north east);},
},
}
\newtcbtheorem[number within=section]{questionbox}{Question}{thmbox}{qst}
\begin{document}
\begin{questionbox}{\lipsum[66]}{qst:1}
\lipsum[1]
\end{questionbox}
\end{document}

\newrobustcmd{\mytitle}{\parbox[t]{0.7\textwidth}{\lipsum[1]}}to make a robust title box and use\mytitleinstead of\lipsum[66]as title. The title in a theorem is just a\hboxwhich does neither wrap etc, unless using an inner parbox. It will not break like the realtcolorboxcontent. Just reduce your title -- that's the best option. – Sep 12 '16 at 05:40Where in my code do I add
\newrobustcmd{\mytitle}{\parbox[t]{0.7\textwidth}{\lipsum[1]}}Wouldn't that print the same title every time? i.e. the contents of
\lipsum[1]? I am still trying to figure out how things work.What I want to do, though, is to enter questions of variable size in the title (possibly up to 3 or 4 lines) and the answer in the body of the theorem box. I guess I'm trying to merge the theorem and the proof environments in the two boxes of
– Mahoma Sep 12 '16 at 06:14tcolorbox, if that makes any sensetcolorboxdocumentation shows several examples like these. Two special examples are shown in my answers to how-to-defer-content-to-a-later-part-of-the-document and hide-content-to-show-later where solutions are shown later on in your document. – Ignasi Sep 12 '16 at 07:41\mytitlebox each time. But the two - box approach is the better one. – Sep 12 '16 at 13:12