1

Latex moves my figure (with [t] specifier) to the last page seemingly because it is tall. Its height is about 70% of the distance between top and bottom margins. Hence, it should be possible to place the figure at the right page. When I decrease the height of the figure to some extent, the figure is placed at the right page. The [p] specifier also maintains the figure with its original height at the right page.

The problem is that how can I keep the figure with its original height and [t] specifier at the right page? (preferably without using packages).

A sample code is as below:

\documentclass[12pt, letterpaper]{article} 
\usepackage{graphicx}
\begin{document}

text ... (e.g. 1 page + 10 lines)

\begin{figure}[t]
\centering
\includegraphics[width=\textwidth,height=15cm]{F1.pdf}
\caption{F1}
\label{FG:1}
\end{figure}

text ... (e.g. 2 page + 20 lines)

\end{document}
Bab
  • 11
  • There is a value called \topfraction (default is 70%) that sets the maximum height of a figure placed at the [t]op of a page can have. If yours exceed this, it'll go on a page of it's own. You mention the "height is about 70%"... my guess is it's just over. So you may have to add \renewcommand\topfraction{.8} or something to fix this. You should play around with the .8 figure. – Werner Feb 05 '19 at 19:10
  • Thank you! \renewcommand\topfraction{.9} solved the problem. – Bab Feb 05 '19 at 19:36
  • At 15cm (the image height you specified), you're already filling 15cm / \textheight = 77.8% of the text block, far bigger than the default 70% (maximum). This doesn't even include the space between the image and caption, the caption itself and the space around the float. – Werner Feb 05 '19 at 19:39
  • Thank you again! The duplicate that you suggested is a complete article that contains the answer to my question. – Bab Feb 05 '19 at 20:04

1 Answers1

2

By using [t] you are restricting the places that latex may place the figure, in particular preventing the use of p that is, placing the figure on a float page. So if it can not fit at the top of a page, it can not go anywhere and will go to the next \clearpage which flushes out pending floats.

The standard classes have

\renewcommand\topfraction{.7}

so at most 70% of a text page may be given to top floats (so you do not end up with a float with just a line or two of the main text flow underneath) which means that if you have a figure that is 70.1% of \textheight and you use [t] then it may not be placed anywhere and will go to the implicit \clear[age at end of document.

If you delete [t] then the default [tbp] would allow it to be placed on a page on its own close to wher you put it or you could increase \topfraction or use [!t] to ignore \topfraction in this one case.

David Carlisle
  • 757,742
  • Thank you! \renewcommand\topfraction{.9} solved the problem. It seems that there are still other parameters that influence the allowed height of figure. Because, I need to set the \topfraction to value which is larger that what is really needed. – Bab Feb 05 '19 at 19:39
  • @Bab it's the height of the entire float and the floatsep space between the float area and the text that must be less than floatpagefraction. – David Carlisle Feb 05 '19 at 19:45
  • @Bab are you sure you want a page with only 10% normal text and the rest a float? if you really have to, I'd use [!t] to allow it on this one page but I'm pretty sure I'd not want to increase the default value that high. Why are you preventing float pages, that have just the figure?, once the figure is that tall, it almost always will look better on its own page. – David Carlisle Feb 05 '19 at 20:07
  • You are right. But, my original document has two columns and a shorter figure on the first column beside a full height text column does not look good. – Bab Feb 05 '19 at 20:40
  • @Bab so why not have just the tall figure in that column? why force a fragment of text on to the page? – David Carlisle Feb 05 '19 at 20:46