Placing the figure exactly at the top of the page in Latex [duplicate]

The problem is that the picture is placed exactly in the middle, although I used position specifier (t!). How can I instruct the latex to put the picture at the top of the page. BTW: this picture is the only element in the page.

asked Aug 7, 2012 at 20:18 545 2 2 gold badges 5 5 silver badges 6 6 bronze badges Commented Aug 7, 2012 at 20:22

Do you have anything else on the other pages, or is your document just a single image that you want at the top of the page?

Commented Aug 7, 2012 at 20:23

@Werner: yes. Its a 100-page document, and this figure is the last element in one of the chapters. Latex puts it on a separate page, but in the middle of the page!

Commented Aug 7, 2012 at 20:29 What total portion of the page is the size of the float? 50%? 70%? 90%? Commented Aug 7, 2012 at 20:32

I assume you issue a \clearpage (or something similar) just before using \begin

. \end
, right? If this is the case, add \mbox<> (or \null ) after the figure environment before starting a new \chapter and your alignment should be fixed. Since there's nothing else on the page, LaTeX centres it, since that would be the best way to present the information.

Commented Aug 7, 2012 at 20:38

1 Answer 1

The vertical spacing above the top floatpage float is defined by \@fptop . The default value of this parameter is 0pt plus 1.0fil . Hence when you have a single figure on a separate page you get white space on top. (Similarly \@fpbot is for bottom space with the value 0pt plus 1.0fil . Hence you get white space on bottom also. And \@fpsep defines the vertical spacing between floatpage floats. The default is 8pt plus 2.0fil ).

To have the figure on top, you have to define @\fptop as

\makeatletter \setlength \makeatother 
\documentclass \usepackage[demo] % \makeatletter \setlength \makeatother % \begin \begin[t!] \centering \includegraphics[keepaspectratio, width=0.6\textwidth] \caption \label \end \end