When putting two floating environments consecutively inside a paragraph as in the example below, TeX seems to insert an additional space after the last floating environment.
\documentclass{article}
\begin{document}
There is an additional space before this
\begin{figure}
\caption{A}
\end{figure}
\begin{figure}
\caption{B}
\end{figure}% <--- gets rid of extra space
word.
\end{document}
Adding %
after the last figure, gets rid of the extra space.
What is the reason for this?