Graphics, Figures & TablesEPS figure not shown and how to include GIF image

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Higgs
Posts: 4
Joined: Mon Apr 06, 2009 9:06 pm

EPS figure not shown and how to include GIF image

Post by Higgs »

Hi
I recently started using LaTeX (MikTeX with the RevTeX 4 style package edited in TeXnic centre) to write a lab report, and whilst I like it so far, I have come across a couple of issues.
Firstly, i have put

\usepackage{graphics}

at the top and then my code for a figure is

\begin{figure}[h]
\includegraphics{C:/cygwin/home/Timmy/backup/computing_course/AFM/lennardjonespotential.eps}
\caption{lennard jones model for the van der waals force}
\label{fig:lennardjonespotential}
\end{figure}

But this doesnt load in the picture when I build it. Have I done something wrong or doesnt this mean there is a problem with my install? ive checked MikTeX to see i have installed the graphics package...

Also, i can't find any ways to either use a GIF/other "normal" image format or convert them to .ps/.eps, so any guidance on this would be appreciated.

Cheers
Tim

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

EPS figure not shown and how to include GIF image

Post by localghost »

Higgs wrote:[...] But this doesnt load in the picture when I build it. Have I done something wrong or doesnt this mean there is a problem with my install? ive checked MikTeX to see i have installed the graphics package [...]
You better use the graphicx package instead. Please be more precise when describing the error. Submit the complete error message given by the compiler. Note that the EPS format for graphics files is only accepted by latex, not by pdflatex. Avoid special characters (blank spaces, underscores) in both the path and the name of the file.
Higgs wrote:[...] Also, i can't find any ways to either use a GIF/other "normal" image format or convert them to .ps/.eps, so any guidance on this would be appreciated. [...]
The GIF format is not accepted at all. Before converting images you should think about your final output format. I remember that this issue occurred some time ago. The search function of the forum should help.


Best regards and welcome to the board
Thorsten¹
Higgs
Posts: 4
Joined: Mon Apr 06, 2009 9:06 pm

Re: LaTeX noob help

Post by Higgs »

Ok, i tried using graphicx and still no luck, it just posts the caption and nothing else because it cant do the EPS file, throwing this error message at me
! LaTeX Error: Unknown graphics extension: .eps.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

EPS figure not shown and how to include GIF image

Post by localghost »

Higgs wrote:

Code: Select all

! LaTeX Error: Unknown graphics extension: .eps.
Obviously you are compiling with pdflatex, which doesn't support EPS but JPG, PDF and PNG. You can convert your EPS files to PDF. The search function of the forum yields lots of hits about this topic.
Higgs
Posts: 4
Joined: Mon Apr 06, 2009 9:06 pm

Re: LaTeX noob help

Post by Higgs »

It is moments like this I realise how much I hate computers.
I tried outputting a jpeg version of the graph from gnuplot and loading that in, and it instead put a box on the page with some really large text over it (not the graph I was expecting). I decided to call it a day and go to bed. After a night's sleep, i turned on the computer, opened the report, hit build and it had the graph in there as expected! Cheers for the pointers about pdflatex and post script files.
I now have a much more minor 2 problems:
There is a lot of white space (about 4 lines) after my first sub-heading which never used to be there. Any ideas what might have caused this and how to get rid of it?
Also, my graph has the file's path written above it. How do I get rid of it?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

EPS figure not shown and how to include GIF image

Post by Stefan Kottwitz »

Hi Higgs,
Higgs wrote: Also, my graph has the file's path written above it. How do I get rid of it?
that could be caused by spaces in the file name, don't use spaces in file names, have a look here.

Stefan
LaTeX.org admin
Higgs
Posts: 4
Joined: Mon Apr 06, 2009 9:06 pm

Re: LaTeX noob help

Post by Higgs »

Cheers Stefan, that was the problem. There was a space in one of the folder names. I moved the image file and now its working great.
Still not a clue about the extra blank lines though. when i cut that whole section out and build, the next section aligns as it should...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

EPS figure not shown and how to include GIF image

Post by Stefan Kottwitz »

Hi Higgs,
Higgs wrote: Still not a clue about the extra blank lines though.
check if \raggedbottom will a positive effect.

Stefan
LaTeX.org admin
Post Reply