[Tex/LaTex] Paragraph breaks inside tcolorbox

paragraphstcolorbox

I have a document full of nicely formatted and separated paragraphs (each separated by two line breaks in the source), which is working nicely. Now I'd like to put some of them into a tcolorbox.

But when the text is inside a tcolorbox, all paragraph breaks are replaced by simple line breaks!

Is there a way I can get normal formatting inside a tcolorbox?

MWE (I'd like the first three and last three paragraphs formatted the same):

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{lipsum}

\setlength{\parskip}{1em}

\begin{document}

\begin{tcolorbox}
\lipsum[1]

\lipsum[2]

\lipsum[3]
\end{tcolorbox}

\lipsum[4]

\lipsum[5]

\lipsum[6]
\end{document}

Best Answer

You can set the parbox key to false:

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{lipsum}

\setlength{\parskip}{1em}

\begin{document}

\begin{tcolorbox}[parbox=false]
\lipsum[1]

\lipsum[2]

\lipsum[3]
\end{tcolorbox}

\lipsum[4]

\lipsum[5]

\lipsum[6]
\end{document}

enter image description here