1

A large figure which takes an entire page (with caption) is a tiny bit too tall for the page and produces a warning ("float too large for page" by ~3pt). Here is the example code:

\subsection{Section heading}
  \label{section:lable}

  \begin{figure}
    \centering
    \includegraphics{figure_name}
    \caption{long description}
    \label{fig:long_figure}
  \end{figure}

Paragraph text...

I tried putting \enlargethispage{\baselineskip} within the figure float but it's being ignored. Putting a negative \vspace within the float works but I don't want the content to be shifted upward but rather extend the page margin downward.

I attached a crappy sketch of the layout around the figure (see below). In the Latex code, the figure is placed between the section heading and the paragraph text in order to have it as close to the section heading as possible. If I put it below the paragraph, it's placed on page 3 because that paragraph has an automatic page break in it (the section heading is near to the bottom of page 1). Basically, I want to put the figure page in between the broken paragraph but this seems to confuse the \enlargethispage command. If I put this command right before or after the figure float, then page 1 is enlarged. If I put it after the broken paragraph, page 3 is enlarged. If I put it anywhere inside the figure float, it's ignored as mentioned before. What's the correct way to enlarge page 2 in this configuration? I could just ignore the warning but I want to know the right solution.

Layout

  • If you want to control where the figure appears, why do you use a figure enviroment? Now LaTeX decides where the figure is placed, which you apparently don't want. – Johannes_B Dec 3 '17 at 9:39
  • 1
    you leave us to guess what you did, which makes it hard to help but I would assume putting \vspace{-4pt} at the end of the figure will make the warning go away without raising the figure on the page.. – David Carlisle Dec 3 '17 at 9:41
  • Ok, putting \vspace at the end works indeed, thanks. I think I tried it at the beginning. Still, I would prefer a solution with \enlargethispage because it preserves the vertical alignment, while for \vspace you have to enter the exact excess length as argument or otherwise the entire float is shifted down. Also, what's wrong with using the figure environment? How else would I get the figure in between an auto-breaking paragraph? – Novgorod Dec 3 '17 at 10:31
  • 1
    \enlargethispage can not possibly work inside any box and certainly not inside a float. – David Carlisle Dec 3 '17 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.