[Tex/LaTex] Remove indent/space left of tcolorbox box

paragraphsparindentparskipspacingtcolorbox

I am using tcolorbox package for creating attractive definition and theorem blocks. But I am facing a problem right now.

If tcolorbox is placed immediately after chapter, section, subsection everything is ok. However, other tcolorboxes in the document have "paragraph-style" left spacing.

enter image description here

How to remove these spaces (they look awful and also generate a lot of "bad box" warnings)?

Example:

\subsection{Синус и тангенс}
%%% Okay here
\begin{definition}[label={def:sinalpha}]
    \textbf{Синус} острого угла $\alpha$ прямоугольного треугольника --- отношение катета, лежащего напротив этого угла, к гипотенузе.
\end{definition}

\begin{equation}
\boxed{\sin(\alpha) = \frac{BC}{AB}}
\end{equation}
%%% Awful spacing
\begin{definition}[label={def:sinalpha}]
    \textbf{Синус} острого угла $\alpha$ прямоугольного треугольника --- отношение катета, лежащего напротив этого угла, к гипотенузе.
\end{definition}

Best Answer

I assume that your problem is related to parskip and parindent.

  1. If \usepackage{parskip} helps than that's an indication that the assumption is correct.
  2. You could alternatively put an \noindent before each box

See also this and that question.