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.

In my document, I have figures that have a rather long caption. The code I use to include them looks like this:

\begin{figure}
  \begin{center}
    \includegraphics[width=\textwidth]{../fig.pdf}
    \caption[Short caption]{Fairly long text...}
  \end{center}
\end{figure}

For some of the figures, I keep getting warnings like this one:

LaTeX Warning: Float too large for page by 2.38557pt on input line 339.

I can't see anything wrong with the figures in the output document, but it makes the compilation output harder to read because it is full of such warnings.

What am I doing wrong, and how can I get rid of these warnings?

share|improve this question

1 Answer 1

up vote 13 down vote accepted

The warnings tell you that the float (figure and caption) are too long for staying in a page. You will get rid of many of those warnings if you avoid the center environment:

\begin{figure}
  \centering
  \includegraphics[width=\textwidth]{../fig.pdf}
  \caption[Short caption]{Fairly long text...}
\end{figure}

(it should be avoided anyway, see Should I use center or centering for figures?).

For pretty high figures you might also want to shorten their width, say 0.95\textwidth or less. LaTeX won't apply such a transformation for you: the warning simply tells that a float needs attention, but how to solve the problem depends on factors that only a human can evaluate properly.

share|improve this answer
    
Thanks for your answer. Why is it better to use centering instead of the center environment in caption? –  Antoine Nov 26 '11 at 16:28
3  
@Antoine: See tex.stackexchange.com/questions/2651/… –  lockstep Nov 26 '11 at 16:29
    
@lockstep Thanks. This link has its place in this answer. –  Antoine Nov 26 '11 at 16:34

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.