Graphics, Figures & Tables ⇒ EPS figure not shown and how to include GIF image
EPS figure not shown and how to include GIF image
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
EPS figure not shown and how to include GIF image
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:[...] 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 [...]
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.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. [...]
Best regards and welcome to the board
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: LaTeX noob help
! LaTeX Error: Unknown graphics extension: .eps.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
EPS figure not shown and how to include GIF image
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 wrote:Code: Select all
! LaTeX Error: Unknown graphics extension: .eps.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: LaTeX noob help
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?
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
EPS figure not shown and how to include GIF image
that could be caused by spaces in the file name, don't use spaces in file names, have a look here.Higgs wrote: Also, my graph has the file's path written above it. How do I get rid of it?
Stefan
Re: LaTeX noob help
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...
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
EPS figure not shown and how to include GIF image
check if \raggedbottom will a positive effect.Higgs wrote: Still not a clue about the extra blank lines though.
Stefan