24

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?

0

1 Answer 1

38

Found the problem.

Just needed to use:

\usepackage{float}
.
.
.
\begin{figure}[H]
    % Figure content
\end{figure}
.
.
2
  • 6
    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. Commented Dec 7, 2012 at 16:52
  • 4
    @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
    Commented Dec 7, 2012 at 17:31

Not the answer you're looking for? Browse other questions tagged .