wrapfigure environment vspace above figure
The output is precisely what's expected, at least judging from the code.
You can remove the space by setting \intextsep
:
\documentclass{article}
\usepackage{lipsum,tikz,wrapfig}
\setlength\intextsep{0pt}
\begin{document}
\begin{wrapfigure}{r}{4cm}
\begin{tikzpicture}
\fill (0, 0) rectangle (4, 4);
\end{tikzpicture}
\end{wrapfigure}
\lipsum[1]
\begin{wrapfigure}{r}{4cm}
\begin{tikzpicture}
\fill (0, 0) rectangle (4, 4);
\end{tikzpicture}
\end{wrapfigure}
\vspace{5mm}
\lipsum[1-2]
\end{document}