0

Here is an example of a TeX code I use:

\begin{figure}[h]
\centering
  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth]{a}
    \caption{some caption}
  \end{minipage}
  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth]{b}
    \caption{some caption}
  \end{minipage}
%\vspace{}
\centering
  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth]{c}
    \caption{some caption}
  \end{minipage}
  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth]{d}
    \caption{some caption}
  \end{minipage}
\end{figure}

\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{e}
\caption{some caption}
\end{figure}

The last figure is always moved to a new page, why is that the case and how do I make it stay on the same page as the above?

4
  • 1
    Likely because there's no room. Try moving \includegraphics[scale=0.5]{e} \caption{some caption} into the first figure environment. Dec 29, 2015 at 11:47
  • Not a space issue for sure
    – Naz
    Dec 29, 2015 at 11:56
  • Well, I couldn't really know the height of your images ... Dec 29, 2015 at 14:14
  • There are limits on how many floats are allowed on the bottom of the page and how large they are. See tex.stackexchange.com/questions/39017/… Some document classes do not allow ANY floats on the bottom. Jan 1, 2016 at 14:56

1 Answer 1

2

Put everything in the same figure environment, that will ensure that they end up on the same page, as figures cannot be broken across pages.

\documentclass{article}
\usepackage{graphicx}
\usepackage{kantlipsum}
\begin{document}
\kant
\begin{figure}
\centering
  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth,height=3cm]{example-image-a}
    \caption{some caption}
  \end{minipage}
  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth,height=3cm]{example-image-b}
    \caption{some caption}
  \end{minipage}

\medskip

  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth,height=3cm]{example-image-c}
    \caption{some caption}
  \end{minipage}
  \begin{minipage}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth,height=3cm]{example-image}
    \caption{some caption}
  \end{minipage}

\medskip

\includegraphics[width=\textwidth,height=3cm]{example-image-16x10}
\caption{some caption}
\end{figure}
\kant
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .