# How do I control parskip within a tcolorbox?

I am using the tcolorbox to provide some beautiful frames around certain parts of my document; I use the parskip to give nice spacing between paragraphs.

When I have more than one paragraph inside a tcolorbox the parskip is not obeyed, as highlighted in the screen shot below. I have searched the manual, but it seems to describe before and after skips, but not 'during'. How can this be fixed?

Here's a complete MWE that demonstrates the problem:

% arara: pdflatex
\documentclass{article}

\usepackage{tcolorbox}
\usepackage{lipsum}
\usepackage{parskip}

\begin{document}

\begin{tcolorbox}
\lipsum[1]

\lipsum[2]
\end{tcolorbox}

\lipsum
\end{document}

• Just in case. If you use KOMA-Script classes, you just need to add \KOMAoptions{parskip = half-} inside the tcolorbox environment. – Manuel Jan 19 '14 at 19:21
• Don't set \parskip, it's easier. ;-) – egreg Jan 19 '14 at 20:56
• @egreg could you elaborate? do you recommend against the parskip package? – cmhughes Jan 20 '14 at 3:20
• I recommend against using a nonzero parskip, which is useful only for commercial letters, in my opinion. – egreg Jan 20 '14 at 7:55

Yes, there is a native tcolorbox solution. The content of a tcolorbox is processed with the typical settings of parbox and minipage. You can switch this kind processing by setting parbox=false to do a mimicry of 'normal' processing.

You find this in the tcolorbox documentation as Text Characteristics (4.18 Text Characteristics on p. 98, for current tcolorbox version 4.22 [2019/11/15]).

\documentclass{article}

\usepackage{tcolorbox}
\usepackage{lipsum}
\usepackage{parskip}

\begin{document}

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

\lipsum[2]
\end{tcolorbox}

\lipsum
\end{document}


• Awesome, thanks so much :) Sorry I missed this in the documentation :) I love your package, thanks so much for all of the work that you have done :) – cmhughes Jan 20 '14 at 16:50
• I also missed that option in the documentation; fortunately we have you here :-) – Gonzalo Medina Jan 20 '14 at 18:36
• @GonzaloMedina My subsection title Text Characteristics may also be better chosen ... ;-) – Thomas F. Sturm Jan 21 '14 at 6:37
• +1: Just what I needed! – Dr. Manuel Kuehner Aug 10 at 16:25

One option would be to use the settings from parskip inside a new environment defined using tcolorbox:

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

\newenvironment{mycolorbox}[1][]
{\if\detokenize{#1}\relax\relax
\begin{tcolorbox}
\else
\begin{tcolorbox}[#1]
\fi
\parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt
\parindent=0pt
}
{\end{tcolorbox}}

\begin{document}

\begin{mycolorbox}
\lipsum[1]

\lipsum[2]
\end{mycolorbox}

\lipsum

\end{document}