Graphics, Figures & TablesFloat Figure on Top or Bottom

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Siavash
Posts: 9
Joined: Tue Sep 27, 2011 1:32 am

Float Figure on Top or Bottom

Post by Siavash »

I'm using the following code to insert graphics into my paper:

Code: Select all

\begin{figure}[!tp]
\centering
\includegraphics[width=\textwidth]{1.eps}
\caption[short] {long}
\label{fig:1}
\end{figure}
Because I'm always adding figures to different parts and I can't go over the whole thing changing the float options, what I want to do is to make figures float on top OR bottom of the page, doesn't matter which. But I want to make LaTeX decide about which one. For example in a page where there is one figure at the top, I want the next figure to float on the bottom. Is there a way to do so?
Thank you for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Float Figure on Top or Bottom

Post by Stefan Kottwitz »

Hi Siavash,

you could use the placement options t for top and b for bottom, so

Code: Select all

\begin{figure}[tb]
or

Code: Select all

\begin{figure}[!tb]
Stefan
LaTeX.org admin
Siavash
Posts: 9
Joined: Tue Sep 27, 2011 1:32 am

Re: Float Figure on Top or Bottom

Post by Siavash »

Thank you for the response. I don't think it's working though. That or Latex is really stupid in deciding where the pictures should be :). Is there an alternative?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Float Figure on Top or Bottom

Post by Stefan Kottwitz »

Hi,
Siavash wrote:I don't think it's working though.
do you just think that? Or did you actually test it? Perhaps show with an example that it doesn't work for you. You could create such a small example by reducing a copy of your document.
Siavash wrote:Is there an alternative?
There are internal parameters for fine tuning floating. But dealing with those values is not meaningful until it's solved why the float positioning arguments t and b don't work for you as they should.

Stefan
LaTeX.org admin
Siavash
Posts: 9
Joined: Tue Sep 27, 2011 1:32 am

Float Figure on Top or Bottom

Post by Siavash »

do you just think that? Or did you actually test it? Perhaps show with an example that it doesn't work for you. You could create such a small example by reducing a copy of your document.
On some instances, a picture is place right after the other one both on the top of the page, and the text begins from the next line. So I guess it's trying to float them both on top position.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Float Figure on Top or Bottom

Post by Stefan Kottwitz »

Try modifying this float placement parameter:

Code: Select all

\setcounter{topnumber}{1}
This means the maximum number of floats at the top of a page. The default value is 2, that's why you noticed that.

Stefan
LaTeX.org admin
Siavash
Posts: 9
Joined: Tue Sep 27, 2011 1:32 am

Re: Float Figure on Top or Bottom

Post by Siavash »

Great. It's working just fine now. Thank you for the help.
Post Reply