18

I have an appendix that contains two full-page figures. The first page of the appendix is always blank except for the title -- I suspect this is a common problem with appendices of full page figures.

I narrowed the problem down to a MWE that, as it turns out can be reproduced without appendices at all. Here it is:

\documentclass{article}
\usepackage[top=1in, bottom=1in, left=0.5in, right=0.5in]{geometry}
\usepackage[demo]{graphicx}

\begin{document}

\section{Big Figure}
\begin{figure}[h]
    \caption{Big Figure}
    \includegraphics[height=0.76\vsize, width=0.4\hsize]{foo.png}
\end{figure}

\end{document}

which yields

enter image description here

Clearly there is enough room to fit this on a single page.

Changing to height=0.75 yields

enter image description here

Note the excessive white space below the figure.

What is going on here? Why can't this figure be bigger without creating a second page?

doncherry
  • 54,637
alx9r
  • 413

2 Answers2

10

Since your image must go in a precise location, it doesn't make much sense to use a floating environment; use a minipage and \captionof (from the capt-of or caption packages) to provide the caption:

\documentclass{article}
\usepackage[top=1in, bottom=1in, left=0.5in, right=0.5in]{geometry}
\usepackage[demo]{graphicx}
\usepackage{capt-of}

\begin{document}

\section{Big Figure}
\noindent\begin{minipage}{\textwidth}
    \centering
    \captionof{figure}{Big Figure}
    \includegraphics[height=0.76\vsize, width=0.4\hsize]{foo.png}
\end{minipage}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • Is this approach somehow fundamentally different from using {figure}[h!]? Don't both approaches essentially mean "put this box here"? It's not clear to me when you would use one versus the other. – alx9r May 07 '13 at 02:39
  • 1
    @alx9r yes, both approaches are essentially different (although the resulting document might look the same in some cases, as in this particular little exmaple); my approach treats the image in a non-floating way. On the other hand, using \begin{figure}[!h]...\end{figure} (which, by the way, is so restrictive that it should be avoided, if possible, and in fact, it's internally changed to [!ht]) still treats the object as a floating object, but overrides values controlling its possible positions; you can see the difference in a real document with some text. – Gonzalo Medina May 07 '13 at 02:58
  • 1
    @alx9r A mandatory reference here (to understand flotation and its ways) is Frank Mittelbach's answer: http://tex.stackexchange.com/a/39020/3954 – Gonzalo Medina May 07 '13 at 03:45
  • Thanks, I don't know how I missed that answer in my search. – alx9r May 07 '13 at 16:51
3

This

\documentclass{article}
\usepackage[top=1in, bottom=1in, left=0.5in, right=0.5in]{geometry}
\usepackage[demo]{graphicx}

\begin{document}

\section{Big Figure}
\begin{figure}[h!]
    \caption{Big Figure}
    \includegraphics[height=0.76\vsize, width=0.4\hsize]{foo.png}
\end{figure}

\end{document}

gives the desired output ([h] is replaced by [h!]). It overrides maximal and minimal values of floats and text.