GeneralFigures Appearing in random places

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
thomasjg
Posts: 3
Joined: Tue Apr 08, 2008 11:07 am

Figures Appearing in random places

Post by thomasjg »

Hi, I've spent the last three hours trying to solve this problem and I've come to the point where my hair is now being pulled out.

I've created a document using

\documentclass[12pt,a4paper]{article}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}

I have a text body of about 15 pages with a bibliography at the end.

Inside my text I have a few figure which i need to be displayed in certain places, however, when compiling the pdf the figures all get dumped at the bottom, each holding there own page.

the command im using for these figures (and a bit of text either side) are as followed:

using a script called pplane7 \cite{pplane} created by John C.
Polking we can see how the nullclines look in the
$(\hat{U}_1,\hat{U}_2)$ plane.

\begin{figure}[h]
\caption{This is the Nullclines of the equations shown in (3.7) and
(3.8). With $\hat{S}=1$, $\hat{k}_0=1$ and $\hat{\tau}_1=2$ }
\begin{center}
\includegraphics[width=0.8\textwidth]{Figure2(Nullclines)}
\end{center}
\label{nullclinesfig}
\end{figure}

So as we can see that




Idealy I would prefer to have the figure appear where I've placed it (i.e. actualy using the [h]). however i can live with the figures appearing at the top of the page. What I can't live with is it all being dumped at the bottom of my pdf. [the files have been converted to .eps and .pdf files]

Any one got any clues..

[just ask if you need more info]

Thanks in advance, Tom.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Figures Appearing in random places

Post by balf »

Try the H option (from the float package).

B.A.
thomasjg
Posts: 3
Joined: Tue Apr 08, 2008 11:07 am

Figures Appearing in random places

Post by thomasjg »

ok, so Ive resized the figures, to 0.6\textwidth and i get

Text

Graph


emptyspace



Text

how do i get rid of this horrid empty space?
[im currently using [h] is there a different h you mean in the float controls?]
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Figures Appearing in random places

Post by balf »

The float package defines a capital [H] parameter, which means 'put the figure here, and nowhere else', in other words, your figure in no more floating, even if it leads to a not particularly aesthetic layout. The usual parameter means more or less put it here, if you please ; you also can try [!h], which means 'put it here as much as you can', but there are a number of layout parameters for floats that can prevent LaTeX to realise what you ask it to do. You should look at question 338 of the UK TeXfaq.

A simpler solution might be to try \raggedbottom in the preamble (the default is \flushbottom).

B.A.
thomasjg
Posts: 3
Joined: Tue Apr 08, 2008 11:07 am

Re: Figures Appearing in random places

Post by thomasjg »

Cheers Balf, that page is very helpful =D

Just to sum up my findings for others reading this thread...

The problem which I had is that my pictures were all been dumped at the end of my compiled pdf.

After spending a good few days trying to solve the problem I had a thought that the problem may be at the root of the situation.

The program I was using [Advance Batch Converter(ABC)] to convert my bmp's to eps' was creating added space to the bottom of the picture. So when it appeared that the pictures were just being dumped at the end it was infact because they couldnt fit anywhere else.

Solution, Photoshop can save images in the eps format. I know this program costs money, but if it can do it without creating the extra nothingness at the bottom of the image then i'm sure other 'free' programs can do it.

Good luck to anyone that has this problem.

Tom
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Figures Appearing in random places

Post by Juanjo »

Two advices:
  • While you are writing a draft version of the document, to see exactly the space occupied by a picture, frame it. So, instead of

    Code: Select all

    \includegraphics[your options]{your file}
    put something like

    Code: Select all

    \setlength{\fboxsep}{0pt}
    \fbox{\includegraphics[your options]{your file}}
    In this way, you can easily see if the picture contains spurious space.
  • You can easily remove parts of an image (as the superfluous space that it may contain) through several options of \includegraphics. Download the epslatex document and look for the viewport, trim and clip options of \includegraphics in Section 7.5 (Tables 2 and 3).
Post Reply