Tell me more ×
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:
How to influence the position of float environments like figure and table in LaTeX?

I've created a PNG image with Microsoft Visio and I want to put it in a document I'm making with LaTeX.

The problem is that the image automatically goes to the next page whenever I try to insert it, when there is a lot of space under the paragraph above it.

I already try trimming and clipping it to see if maybe the figure simply had lots of blank space above it, but it doesn't, annd it goes to the next page for no reason.

I tried the following:

\begin{figure}
    \begin{center}
    \includegraphics[width=0.8\textwidth]{fig_name}
    \caption{insert caption}
    \label{fig: figure}
    \end{center}
\end{figure}

The problem is that it doesn't work. Does anyone know where the problem is?

share|improve this question

marked as duplicate by egreg, David Carlisle, Kurt, lockstep, Werner Dec 7 '12 at 17:29

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

Found the problem.

Just needed to use:

\usepackage{float}
.
.
.
.
.
begin{figure}[H]
.
.
share|improve this answer
2  
well, "needed" isn't quite the word to use, H is a sledgehammer to use as a last resort when trying to crack an egg. – David Carlisle Dec 7 '12 at 16:52
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Kurt Dec 7 '12 at 17:09
@DavidCarlisle OK. Didin't know that ... do you know any other way to do it? I've been using latex for only 1 day and I'm rather lost – morcillo Dec 7 '12 at 17:31
1  
@Kurt Why doesn't it provide an answer to my question? Maybe I phrased it wrong? And about the rest of your comment: I shouldn't have answered my own question? Sorry if I misunderstood, but I couldn't understand the sentence ... I use English every single day, but it isn't my first language – morcillo Dec 7 '12 at 17:34
Have you visited the link at the beginning of your question (possible duplicate)? There you will found a proper answer to your question. Your here given answer is more a comment than a complete and good answer (compare with the answers of the linked question). And as David said H is not the best to solve the problem. – Kurt Dec 7 '12 at 17:44
show 2 more comments

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