Remove space after \captionof
It is sometimes confusing to distinguish between aboveskip
and belowskip
because their meaning sometimes change according to the value of position
. It is discussed in section 2.6 of caption
's documentation. To avoid confusion in a case like this, it might be better to set skip
to zero.
\documentclass{article}
\usepackage[svgnames,usenames,dvipsnames,table]{xcolor}
\usepackage[showframe=false]{geometry}
\usepackage[many]{tcolorbox}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{lipsum}
\newtcolorbox{texample}[1][]{float, notitle, #1}
\usepackage{float}
\floatstyle{plain}
\newfloat{example}{thp}{lop}
\floatname{example}{\textsc{Figure}}
\begin{document}
\lipsum[2]
\begin{texample}[bicolor,sharp corners,
colback=white,colframe=gray!20,colbacklower=gray!20,
top=1mm,bottom=1mm,middle=1mm]
\centering
\includegraphics[width=.25\linewidth]{example-image}
\tcblower
\captionsetup{skip=0pt}
\captionof{example}{Caption content}
\end{texample}
\lipsum[2]
\end{document}