Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Table in LaTeX appearing in middle of next page

I'm triying to make an image appear on top, but only works if I have some text, otherwise, the image appears at the center (vertical alignement). If I only put the image, I can make it appear on top, but if I add some text (leaving no space for the image in that page), the image appears on the next page, but at the center. I been looking into many forums and I didn't find an answer yet ... I'm losing my mind, because I need to put every image on top (even if it's alone on a page).

Here's a minimal example:

\documentclass[lettersize,oneside,11pt]{book}
\usepackage{graphicx}
\usepackage{blindtext} % for dummy text

\begin{document}

\blindtext
\blindtext
\blindtext

\begin{figure} [htbp] 
\includegraphics[width=0.8\columnwidth]{figure xx}
\caption{figure xx}
\label{fig:figure xx}
\end{figure} 

\end{document}

My image is a PNG file and if you run this example with any image, you will notice that the text is on the first page, and the image on the second one vertically centered. But I want to have it on top.

I tried [t], [!t], [!ht], ... all combinations I guess without good results.

share|improve this question

marked as duplicate by Gonzalo Medina, lockstep, Stefan Kottwitz Apr 24 '12 at 16:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
    
Adding \makeatletter \setlength{\@fptop}{0pt} \makeatother seems to move the figure to the top. –  Peter Grill Mar 29 '12 at 0:04

2 Answers 2

Now check it:

\documentclass[lettersize,oneside,11pt]{book}
\usepackage{graphicx}
\usepackage{blindtext} % for dummy text

\makeatletter
    \setlength\@fptop{0\p@}
\makeatother

\begin{document}

\blindtext
\blindtext
\blindtext

\begin{figure} [htbp]
\includegraphics[width=0.8\columnwidth]{figure xx}
\caption{figure xx}
\label{fig:figure xx}
\end{figure}

\end{document}
share|improve this answer
    
Thank you!!! Works perfectly –  Álvaro Paredes Mar 29 '12 at 13:32
    
@ÁlvaroParedes: Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count. This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). –  Marco Daniel Apr 9 '12 at 10:16

Actually I don't get what your trying to do. You want to place the picture w/o any text on the top of the page? The problem is, that the image is centered in this case, right?

Try to add the following lines after your image; this fills up the rest of the page and should place the image on top of the page - in case you want that at all :)

\null
\vfill
share|improve this answer
    
Thanks!! This do what I need –  Álvaro Paredes Mar 29 '12 at 13:32
    
@ÁlvaroParedes: glad I could help. Please mark as solved (check answer) ;) –  Eric Mar 29 '12 at 20:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.