# Figure placed at the end of the file [duplicate]

I'm doing this

\section{Use Case Description}

\begin{figure}[h]
\centering
\caption{Diagramma degli use case}
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{UCD.pdf}
\end{figure}

\vskip 0.6cm \textbf{Titolo:} UC Create Tag
...


and then there's the rest of my file.

My problem is that the figure renders correctly but just at the end of the file instead of where I've placed it.

If I put no placement parameters, it renders in the next page (as it is supposed to do, I think).

I would like to render it before anything else, but [h] or [h!] didn't work.

## marked as duplicate by Marco Daniel, egreg, Seamus, Stefan Kottwitz♦Jan 14 '12 at 12:31

• It's a FAQ; in this case probably a \clearpage before \section will do. But leave these adjustments for the final revision part of document preparation. – egreg Jan 1 '12 at 14:35
• not really, i've understood how floating should work, but this is an unexpected behaviour. @egreg nothing happened – Chobeat Jan 1 '12 at 14:36
• Oh, well! I didn't notice width=\textwidth and height=\textheigth! If these produce a figure that's bigger than 70% of the page height, the figure will never be printed "here", but always as a page float. – egreg Jan 1 '12 at 14:41
• @egreg ok now it works. – Chobeat Jan 1 '12 at 14:48

You should have a look at How to influence the position of float environments like figure and table in LaTeX?, that has very detailed information about float placement.

width=\textwidth,height=\textheight

is probably producing a figure which is higher than the maximum allowed, which by default is 70% of the text height. Moreover you have a section title, quite certainly the cause of even [!h] not working: if the section title height plus the figure height are more than the page height the combination will not be squeezed in a page.
Either put a \clearpage before \section and reduce the figure's height or be content that LaTeX puts the figure on a page by itself (placement option [p]).