# Equalise spacing before and after tcolorbox environment

I don't like tampering with the AMStheorem default theorem styles (theorem, definition and remark), I find they fit my needs well.

In this instance, I am using tcolorbox to draw boxes around definitions. For some reason, there is an unequal amount of spacing before and after the definition box. But what's strange is the following. I am using the following packages (among others): parskip, hyperref, and cleveref. Commenting out any one out of these three makes the problem go away!

Here is an MWE:

\documentclass[11pt]{article}

% Necessary packages
\usepackage{amsthm}
\usepackage[most]{tcolorbox}

% Problem Packages
\usepackage{parskip}
\usepackage{hyperref}
\usepackage{cleveref}

\theoremstyle{definition}
\newtheorem{definition}{Definition}

% Coloured box around definitions
\tcolorboxenvironment{definition}{
sharp corners,
frame hidden,
breakable,
enhanced,
colback=gray!12,
parbox=false
}

\begin{document}
\begin{definition}[Hilbert Space]
An inner product space $X$ is said to be a \emph{Hilbert Space} if it is complete with respect to the induced metric.
\end{definition}
\end{document}


Try commenting out any of the three "problem packages" there, and the spacing is fixed.

How can I go about getting equal spacing? I could add top = -1pt to the tcolorboxenvironment definition, but is there a different way to go about this keeps things "default"?

• Did you try loading the tcb library theorems and use the \newtcbtheorem command to define your environments? – Bernard Jun 16 at 12:06