# Image positioning problems [duplicate]

Possible Duplicate:
Keeping tables/figures close to where they are mentioned

I'm having troubles positioning some images. Some appear where i want them to, others appear right at the end of the document.

\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{images/cleanity.jpg}\\
\caption{Rapid Application Development (RAD) Model}\label{fig:sift_ex}
\end{figure}


I have a bunch of subheadings and my bibliography after this code, but the image appears after. What am i doing wrong?

-
It may be that your image is actually too big to fit within the text block. Issue \clearpage to flush any existing (backed-up) floats. Also, float placement is not always as simple as specifying [h] for here. See How to influence the position of float environments like figure and table in LaTeX? –  Werner Apr 3 '12 at 16:59
using [h] on its own almost always results in the floats going to the end of the document as its main effect is to not allow latex to put the float in the t or p positions, use [htp] unless you have really good reason not to. –  David Carlisle Apr 3 '12 at 17:18
add comment

## marked as duplicate by cmhughes, Ian Thompson, lockstep, egreg, JakeApr 5 '12 at 20:21

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.

## 1 Answer

Figures float - LaTeX puts them where it thinks best. The [h] directive for "here" is only your suggestion, In this case it won't fit and can't go anywhere else, so LaTeX put it at the end of the document. (See comment below.)

You can force the image to be "here" if you just include it, centered, followed by its caption - but then it won't appear in the List of Figures, and it may leave lots of white space on the page or the next page. If you have to have the caption, a possible hack would be to include the image just centered, then create a Figure with just a caption. That might be small enough so that LaTeX would put it where you want it. A better TeX wizard than I might well have a better answer.

See this wikibooks page

-
@Werner I should have waited for your comment above. –  Ethan Bolker Apr 3 '12 at 17:19
saying that latex thinks the end of document is best is misleading. It goes to the end of the document as [h] prevents the float being placed at the top of any page [t] or on a float page [p] so most of the time it won;t fit "here" (because that point is too far down the page) so the float can not be placed anywhere so is dumped at the end as emergency error recovery. –  David Carlisle Apr 3 '12 at 17:21
@DavidCarlisle Thanks. You taught me more about the position specifiers, and have edited the answer appropriately. –  Ethan Bolker Apr 3 '12 at 18:39
add comment