3

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

4
  • 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. Commented Dec 3, 2017 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.. Commented Dec 3, 2017 at 9:41
  • 1
    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? Commented Dec 3, 2017 at 10:31
  • 2
    \enlargethispage can not possibly work inside any box and certainly not inside a float. Commented Dec 3, 2017 at 12:50

1 Answer 1

3

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.

2
  • Unfortunately, "shrinking" the length of a page by this method might also result in overprinting a bottom-positioned page number. But that could simply be eliminated by \thispagestyle{empty} (which is allowed inside a float). Commented Dec 25, 2019 at 23:33
  • @barbarabeeton it's allowed in the sense of not giving an error but it doesn't do anything useful. Commented Dec 25, 2019 at 23:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.