[Tex/LaTex] How to prevent a large figure occupying entire page

floatsgraphics

I have to embed a huge figure in a page where at the bottom there should be some text. However, the figure simply occupy a new page — how to prevent this?

Best Answer

This is one of the possibilities suggested as use by the afterpage package:

enter image description here

\documentclass{article}
%\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{afterpage}% http://ctan.org/pkg/afterpage
\usepackage{float}% http://ctan.org/pkg/float
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\lipsum[1-3]
\afterpage{%
  \begin{figure}[H]
    \centering
    \rule{.8\textwidth}{.8\textheight}% Your image
    \caption{This is a HuGe figure.}
  \end{figure}
}
\lipsum[4-6]
\end{document}​

The use of the H float specifier (supported by the float package) is crucial here and suppresses the floating. Of course, using \captionof (from the capt-of package) is also a possibility.

The default for very large floats is to sit on a page of its own, the above circumvents that. The default is controlled by macros like \topfraction and \bottomfraction. See the layouts package documentation for more on this.

Related Question