LaTeX forum ⇒ General[SOLVED] Help on figure environment.

LaTeX specific issues not fitting into one of the other forums of this category.
cryptod
Posts: 2
Joined: Fri Jun 13, 2008 2:25 am

[SOLVED] Help on figure environment.

Postby cryptod » Fri Jun 13, 2008 2:35 am

Hi,
I have a document written as follow:
...
some text..
figure...
some text2..
figure2...

When i compile the document, i get:
some text..
some text2..
figure...
figure2...
i know that i got this because the space after my text can't hold the figure, but i dont want it to be filled with the other text, i just need it blank!
i messed up with the [htp] options, but il doesn't really help. The order in my document is really important, i want figure1 to figure directly after the text1.

How can i force LaTeX to really use the [h] option?
Last edited by cryptod on Fri Jun 13, 2008 3:05 am, edited 1 time in total.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Jun 13, 2008 2:55 am

Hi,

you could use the float package:
  1. \usepackage{float}
  2. \begin{figure}[H]
  3. ...
  4. \end{figure}

Alternatively, what I would prefer, you could remove the figure environment around the object. Then it doesn't float, and if you want a caption and an entry in the list of figures you could use \captionof from the caption package:
  1. \usepackage[labelfont=bf]{caption}
  2. ...
  3. \begin{center}
  4. \includegraphics{...}% whatever ...
  5. \captionof{figure}{description}\label{fig:test}
  6. \end{center}

For more options and features have a look at the caption documentation.

Similare questions were posted to this forum before, the forum search function would lead you to more examples.

Stefan
LaTeX.org admin

cryptod
Posts: 2
Joined: Fri Jun 13, 2008 2:25 am

Postby cryptod » Fri Jun 13, 2008 3:05 am

Thanks for the quick answer, i used the caption package and it worked.


Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests