My code is:
\documentclass{article}
\usepackage[table]{xcolor}
\definecolor{background}{rgb}{1,0.62502,0}
\usepackage{wrapfig}
\setlength\intextsep{0pt}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{l}{6.5cm}
\noindent
\fcolorbox{background}{background}{
\begin{minipage}{0.5\textwidth}
Some text. \lipsum[4]
%\fcolorbox{frame color}{box background color}{text}
\end{minipage}}
\end{wrapfigure}
\lipsum[1]
\end{document}
Which gives:
I'm mostly satisfied with this, but it's clear that the lines of text in the minipage environment (further in the wrapfigure environment) is not clearly horizontally aligned with the surrounding text. Is there a way to horizontally align the lines of text within the wrapfig environment with the surrounding text?
When I removed the internal minipage environment, I think that did get the job done of horizontally aligning the text. However, I would like to keep the minipage environment to keep the background colour of my wrapped text.


listing. When I addhyperrefhere I fail to see the loss of alignment you mention. – Simon Dispa Apr 16 '22 at 16:06