GeneralInclude eps files

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
t_elsal
Posts: 2
Joined: Wed May 16, 2007 3:31 pm

Include eps files

Post by t_elsal »

Hi all;
I want to add a figure in eps file extension.I usually use this command to open jpg files

Code: Select all

\begin{figure}[h]
	\centering
		\includegraphics{1_a}
	\label{fig:1_a}
\end{figure} 
where 1_a is a jpg file.When I tried it to open 1_b.eps file ,the environment gave me an error

Code: Select all

\begin{figure}[h]
	\centering
		\includegraphics{1_b}
	\label{fig:1_b}
\end{figure}
"Latex Error:File `1_b' not found'
By the way the file is included within the same directory and
I have included \documentstyle[epsf] at the begining of my document.
I asked some other people they said that when they use Winedit ,it will not give them this error.

Recommended reading 2024:

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

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

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

Include eps files

Post by localghost »

No "_" outside a mathematical environment! And, is it right that you are using the old LaTeX 2.09 syntax? Instead of the old and obsolete epsf style you should use the graphicx package.

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}        % Cork Encoding
\usepackage{latin1}{inputenc}   % Special characters
\usepackage{graphics}           % Graphics treatment

\begin{document}
  \begin{figure}[!ht]
    \centering
    \includegraphics{1-a}
    \caption{Figure 1-a}\label{fig:1-a}
  \end{figure}
\end{document}
User avatar
countbela666
Posts: 64
Joined: Thu Apr 26, 2007 2:44 pm

Re: eps files

Post by countbela666 »

Hi,

are you aware of the fact that the possible graphics type depends on the way you compile your document?

If you are running LaTeX (regardless whether you postprocess with dvips and ghostscript) you can only use EPS by default. If you are running pdfLaTeX you can only use PDF, PNG and JPG by default.

As you posted that you are used to include JPG files I assume you are running pdfLaTeX which does not allow EPS files offhand. If you want to precede in using EPS files while directly producing PDF output via pdfLaTeX you should do one of the following:

1. externally convert your graphics files via the tool epstopdf
2. use the epstopdf package which does (1) on the fly
3. use the pst-pdf package (requires compiling via a shell script, but much more powerful)

And another thing: forget about \documentstyle{epsf}, this is an ancient LaTeX2.09 package which nowadays only wraps the graphicx package. So replacing it by \usepackage{graphicx} should work as well and is state of the art.

Regards
Marcel

EDIT: hi localghost, you've been faster than me once again
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
t_elsal
Posts: 2
Joined: Wed May 16, 2007 3:31 pm

Re: eps files

Post by t_elsal »

Thank you for your valuable information.
About the tool epstopdf,I tried to check it out
I have extracted the folder that has the package into the same directory that contains the eps files
I have added the path of gswin32c in my environment variables in windows and then I went to the DOS environment and I tried to run "make", it was not regonized by the system.Any help I will appreciate.

Thanks
User avatar
countbela666
Posts: 64
Joined: Thu Apr 26, 2007 2:44 pm

Include eps files

Post by countbela666 »

Which LaTeX distribution do you use? As your OS seems to be Windows I assume you use MiKTeX. The epstopdf tool is already part of the MiKTeX distribution. You find it as an executable in the binary folder of the MiKTeX installation (for example c:\program files\miktex 2.5\miktex\bin).

Otherwise you find it as executable on a CTAN mirror of your choice, for example here: ftp://tug.ctan.org/pub/tex-archive/supp ... stopdf.exe. Under Windows you neither have to execute the perl script nor the makefile. Just copy the binary to a folder you want and use it (provided that you have Ghostscript installed, and the path to it is part of your PATH environment variable).

Regards
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
carla
Posts: 3
Joined: Fri Jun 01, 2007 7:28 pm

Re: eps files

Post by carla »

Hallo!
I have the same problem with TexnicCenter. I tried to insert a .eps file and a .jpg file. I compiled latex->pdf, latex->ps->pdf, I tried all options. Nothing works.

Help!

Thanks.
carla
Posts: 3
Joined: Fri Jun 01, 2007 7:28 pm

Re: eps files

Post by carla »

I found a solution!
If you want to include .jpg or .pdf files:
1. change the driver: \usepackage[pdftex]{graphicx}
2. build with: latex=>pdf
3. \includegraphics[]{filename.jpg}
Post Reply