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:
Keeping tables/figures close to where they are mentioned
How to influence the position of float environments like figure and table in LaTeX?

I'm doing this

\section{Use Case Description}

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

\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.

share|improve this question

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

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.

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

1 Answer 1

up vote 8 down vote accepted

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.

In particular, your setting of


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]).

share|improve this answer
Is there some way of changing this default maximum height? –  Faheem Mitha Nov 19 '12 at 15:13
@FaheemMitha Look at the highest voted answer to this question for a list of the parameters, their meaning and the way to change them. –  egreg Nov 19 '12 at 17:01

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