Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

share|improve this answer
    
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 7 '13 at 2:39
    
@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 7 '13 at 2:58
1  
@alx9r A mandatory reference here (to understand flotation and its ways) is Frank Mittelbach's answer: tex.stackexchange.com/a/39020/3954 –  Gonzalo Medina May 7 '13 at 3:45
    
Thanks, I don't know how I missed that answer in my search. –  alx9r May 7 '13 at 16:51
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.