# TASKS package issue with TColorBox: unwanted carriage returns

The package TASKS is very useful for horizontal lists. However, when using Tasks lists inside TColorBoxes, Tasks behaves oddly, adding carriage returns when not necessary. Is there a way to restore a normal behavior to Tasks ?

\documentclass[]{book}
\usepackage{tcolorbox}
\begin{document}

colframe=blue!70!black,
colback=blue!2!white,
fonttitle=\bfseries\huge
}}

label-format={\color{green!70!black}\large\bfseries},
}

\def\ContentOfBox{%
%
\bfseries Tasks in 3 columns \normalfont
\noindent\rule{2cm}{0.4pt}\\[2mm]
%
\bfseries Tasks in 4 columns \normalfont
\noindent\rule{2cm}{0.4pt}\\[2mm]
%
\bfseries Tasks in 5 columns \normalfont
\noindent\rule{2cm}{0.4pt}\\[2mm]
%
\bfseries Tasks in 6 columns \normalfont
\noindent\rule{2cm}{0.4pt}\\[2mm]
%
\bfseries Tasks in 7 columns \normalfont
}

\begin{tcolorbox}[MyTasksInTColorBox,title= {Tasks in (4) and (5) columns have a carriage return issue  (width = linewidth)}]
\ContentOfBox
\end{tcolorbox}

\begin{tcolorbox}[MyTasksInTColorBox,width=1.1\linewidth,title= {Tasks in (5) and (7) columns have a carriage return issue (width = 1.1*linewidth)}]
\ContentOfBox
\end{tcolorbox}

\begin{tcolorbox}[MyTasksInTColorBox,width=1.2\linewidth,title= {Tasks in (5) and (6) columns have a carriage return issue (width = 1.2*linewidth)}]
\ContentOfBox
\end{tcolorbox}

\begin{tcolorbox}[MyTasksInTColorBox,width=1.3\linewidth,title= {Tasks in (4), (5), (6) and (7) columns have a carriage return issue (width = 1.3*linewidth)}]
\ContentOfBox
\end{tcolorbox}

\end{document}


• I removed the 2nd question. The \raggedbottom is unecessary if tcolorbox is not loaded. May 22, 2018 at 17:27

Section 4.18 of the tcolorbox manual (Version 4.21) discusses the parbox= setting:

The text inside a tcolorbox is formatted using a LATEX minipage if the box is unbreakable. If breakable, the box tries a mimicry of a minipage. In a minipage or parbox, paragraphs are formatted slightly different as the main text. If the key value is set to false, the normal main text behavior is restored. In some situations, this has some unwanted side effects. It is recommended that you use this experimental setting only where you really want to have this feature.

Thus, using parbox=false should restore normal formatting.

I also included left=pt and right=0pt to eliminate the padding on the left and right

\tcbset{MyTasksInTColorBox/.style={
colframe=blue!70!black,
colback=blue!2!white,
fonttitle=\bfseries\huge,
parbox=false,
left=0pt,
right=0pt,
}}


• +1, I have been waiting for this answer for months! Sep 25, 2019 at 7:44