I have a large document based on the book documentclass with text and images, and sometimes I encounter a new sentence that has a huge space after a period.
It looks like this:

I have attempted to make a MWE, but failed to get the problem.
This problem generally occurs when I have code that has this general structure:
A sentence that explains something shown in the images.
%
\begin{figure}[!ht]
\begin{minipage}[t]{0.48\textwidth}
\includegraphics[clip=true, trim=0 0 0 0, width=0.9\linewidth, angle=0]{image}
\end{minipage}
\hfill
\begin{minipage}[t]{0.48\textwidth}
\includegraphics[clip=true, trim=0 0 0 0, width=0.9\linewidth, angle=0]{image}
\end{minipage}
\end{figure}
%
\begin{figure}[htpb]
\includegraphics[clip=true, trim=0 0 0 0, width=0.8\linewidth, angle=0]{image}
\end{figure}
%
Another sentence that continues on the explanation.
It compiles then to something like this:
A sentence that explains something shown in the images. Another sentence that continues on the explanation.
<image><image>
<image>
What could be causing this large jump? Is there some package/option that is known to give this discrepancy? As said I've tried to compile a MWE but failed to achieve this "error". If I knew what might cause this I could re-attempt to produce an MWE.
figureenvironments between paragraphs, not inside them. – egreg Mar 20 '14 at 15:31\end{figure}to\end{figure}%twice. There are spaces at the end of the lines. – Malipivo Mar 20 '14 at 15:36% at eolquestion. For a single figure you don't need the%and LaTeX explicitly checks for and compensates for any white space. It is just that its checks can not cope with a run of alternating insert and space nodes. – David Carlisle Mar 20 '14 at 16:35