\documentclass{article}
\usepackage[table]{xcolor}
\definecolor{background}{rgb}{1,0.62502,0}
\usepackage{caption}
\usepackage{lipsum}
\usepackage{hyperref}
\hypersetup{
colorlinks = true,
urlcolor = blue,
linkcolor = blue,
citecolor = red
}
\usepackage{wrapfig}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{l}{6.5cm}
\noindent
\setlength{\fboxsep}{0pt}
\fcolorbox{background}{background}{
\begin{minipage}[t]{0.5\textwidth}
\lipsum[4]
%\fcolorbox{frame color}{box background color}{text}
\end{minipage}}
\end{wrapfigure}
\lipsum[1]
\end{document}
The vertical misalignment between the text in the minipage and the text around it is very slight, but noticeable (see esp the bottom of the snip and how the bottom of the p is cut off in the minipage but largely visible in the adjacent line in the wrapped text). When I remove \usepackage{caption} from the above code, the text in the minipage becomes aligned with the wrapping text:
How can I stop the caption package from producing this vertical misalignment?



minipage([b]) or center[c]aligned, then with and without thecaptionpackage produce the same result. – Steven B. Segletes Apr 16 '22 at 16:53captionhasn't anything with space around your wrap figure. If you omit minipage position option[t]your wrapfigure is nice centered. If you like to have less vertical space around it, you need manually set its height, for example:\begin{wrapfigure}[14]{l}{6.5cm} \vskip-0.5\baselineskip˙– Zarko Apr 16 '22 at 17:10[b]or[c]option ofminipageis used. – Steven B. Segletes Apr 16 '22 at 17:12