[Tex/LaTex] \enlargethispage command inside a float

floatspage-breaking

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

Best Answer

You can not use \enlargethispage inside any box (and certainly not inside a float box) but you can hide the size of the float by putting \vspace{-4pt} at the end of the figure will make the warning go away without raising the figure on the page.