2

I am new to LaTeX. I am trying to include and graph in .eps format in my LaTeX document. I shrink the image to half its size, but for some reason, LaTeX still putting it on its own page, with a small graph in the middle and a lot of white space. I would like this graph to be placed at the top of the page with text underneath. Any help would be greatly appreciated.

My packages are:

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mitpress}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{float}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage[left=63.2363pt,right=63.2363pt,top=90.3375pt,bottom=90.3375pt]{geometry}

And the code for my figure is:

\begin{figure}[ht]
\centering
\includegraphics[trim = 0 0 0 0,clip=true,scale = 0.5]{graphs/fig_hazards_comb}
%\caption{This is the caption}
\end{figure}
\clearpage
Martin Scharrer
  • 262,582
  • Hello. Do answers to this question help? – Seamus Apr 01 '11 at 17:20
  • Thanks for you link Seamus. Unfortunately, no. I tried the [!ht] option, but that doesn't help. I am fine with Latex's placement of the figure. But, I shrink it down so that I can get text on the same page after the image. However, even if I shrink it down, the text doesn't appear until the following page, leaving a small figure in the middle of the figure page. I tried to crop the image to see if there was extra white space, but there is not. –  Apr 01 '11 at 17:51
  • 1
    If I had to guess I would say the bounding box of the eps file is too big for the content. If you increase the numbers you put into the trim option (or take it out altogether) do things change? Where did this eps file come from? – Matthew Leingang Apr 01 '11 at 17:58
  • 1
    Thanks for everyone's help. I just erased the \clearpage that appears at the end of my figure environment, and everything works fine. I though that I needed to use \clearpage to place all of the figures that had been inputted up to that point. But, I guess it also causes a page break. Sorry for the confusion. New latex user. –  Apr 01 '11 at 18:13
  • @Bob: Please note that you need to accept an answer to make the question as answered. Otherwise it will spook around as "unanswered". You can accept an answer by using the tick mark beside it. – Martin Scharrer Apr 01 '11 at 19:11

1 Answers1

3

The \clearpage below the figure forces the immediate placement of the figure and then a new page. It seems that the figure doesn't fit on the current page neither here nor on top. It is therefore pushed on the next page which is otherwise empty because of the directly following \clearpage.

LaTeX refuses to make a normal text page which only holds one figure and creates a "float only" page (p) where the figure (or figures if there would be more) is placed centered on the page independent of its size.

So to fix this remove the \clearpage and try how it works out. If you really want to force the placement of all unplaced floats use either \afterpage{\clearpage} (needs the afterpage package) or \FloatBarrier (placeins package).

Martin Scharrer
  • 262,582