Compiling the following code
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1] aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
aaaa
\lipsum[1]
\end{document}
returns two paragraphs as expected.
But if a figure is placed after the first paragraph,
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1] aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
aaaa
\begin{figure}
\caption{A}
\end{figure}
\lipsum[1]
\end{document}
LaTeX inserts a vertical space between the two paragraphs.
If a %
-character is added at the end of the first paragraph or a blank line is added before the figure, the vertical space disappears and the ouptut matches the first one. This only seems to happen if the first paragraph ends in a full line.
Why does this happen and should therefore every float be preceded with a blank line?