[Tex/LaTex] Page breaks after images in figures / minipages

floatsspacing

I'm using minipage environments for two images next to each other in a paper. My code looks like this:

    \begin{figure}[htb]
        \centering
            \begin{minipage}{0.5\textwidth}
                \center \includegraphics[width=7.8 cm]{./lorem.jpg}
                \caption{Lorem Ipsum}
            \end{minipage}\hfill
        \centering
            \begin{minipage}{0.5\textwidth}
                \center \includegraphics[width=7.8 cm]{./ipsum.jpg}
                \caption{Ipsum Lorem}
            \end{minipage}      
    \end{figure}

When these images occur at the end of a page, however, and there's not enough room, they are moved to the following page. That's how it's supposed to be, of course; but when this happens, the space after the figure becomes too big. The space has the right size when the figure occurs somewhere in the middle of a page.

By inserting a \clearpage right before the figure manually, I can solve the problem. But as I'd have to do this everytime I change details of the layout, that's not really the best way.

Any suggestions how to solve this problem?

Best Answer

The space before and after in-text floats is determined by the \intextsep length (in standard classes, by default, 12pt plus 2pt minus 2pt), while the space after top floats and before bottom floats is determined by \textfloatsep (by default, 20pt plus 2pt minus 4pt). To achieve your desired layout, add the following to your preamble:

\setlength{\textfloatsep}{12pt plus 2pt minus 2pt}

See this answer for an overview of float layout parameters.

Related Question