# Thread: Including eps in LaTeX file

1. ## Including eps in LaTeX file

I'm trying to compile (not sure if that's the right word) my LaTeX coursework, which includes an esp graphics file. My code is here. I found somewhere on the web that said to type latex integration_notes dvips -Ppdf in the terminal. I don't know if I might have a required package missing?
Thanks

Luke

2. A Carafe of Ubuntu
Join Date
Jun 2006
Location
Bengaluru
Beans
118
Distro
Ubuntu 8.04 Hardy Heron

## Re: Including eps in LaTeX file

It is called latexing (la-te-ch-ing). Open a terminal and change your directory to the directory you have your integration.tex file. Then run the command

latex integration_notes.tex

## it creates a dvi file called integration_notes.dvi, if there are no errors
## make sure that the figures are in the same directory too

## your file has only two errors about newline (at line nu 73 & 77
## as these donot affect the final output, just enter when it stops
## then run
dvips -Ppdf integration_notes -o

## this will create a pdf file by name integration_notes

Goodluck

Girish

3. ## Re: Including eps in LaTeX file

Thanks for replying. When I run the second line of code, it creates a PostScript file, not a pdf. Do you know why this is? How can I change to to a pdf? Thanks again.

Luke

4. Just Give Me the Beans!
Join Date
Jan 2006
Beans
74

## Re: Including eps in LaTeX file

dvips mean dvi->ps.
To get a PDF you have to use the dvipdf command.
So this should give you what you want:
latex integration_notes
dvipdf integration_notes.dvi

5. Iced Blended Vanilla Crème Ubuntu
Join Date
Jul 2005
Beans
1,535
Distro
Ubuntu 8.04 Hardy Heron

## Re: Including eps in LaTeX file

You can also produce pdf's directly using pdflatex
Code:
pdflatex integration_notes.tex
Note however, that pdflatex doesn't work with eps figures yet (technically it is still beta software.) You will have to convert all eps figures to pdfs using the command epstopdf. However, pdflatex will work with png's and jpg's which is really nice.

6. ## Re: Including eps in LaTeX file

Thanks for that. All works well. The graphic seems to be of a lower quliaty in the pdf, but I guess that's something to do with it no longer being a PostScript file. Thanks again for all you help.

Luke

7. Iced Blended Vanilla Crème Ubuntu
Join Date
Jul 2005
Beans
1,535
Distro
Ubuntu 8.04 Hardy Heron

## Re: Including eps in LaTeX file

Looking at your source code, there is a mistake. You shouldn't be putting the file extension when using the \includegraphics command. It should be:

Code:
%\newline  %% You should be letting latex place stuff, why are you trying to move it?
\begin{figure}[htb]  % You can use the htb to tell latex: place here if possible, if not try top of page, if not try bottom of page.
\centering
\includegraphics{fig1}  % Do not put file extension, only name
\caption{Example Figure}
\label{fig:fig1}
\end{figure}
%\newline   %% Again, let latex place stuff where it wants to

8. ## Re: Including eps in LaTeX file

Hi thanks for your suggestions. I didn't realise I didn't need the file extension for the graphics file, as we've only been taught to do things like \includegraphics{fig1.jpg}. The \newline lines are there from when I tried to remind myself that I needed to include the graphics file later, and I just forgot to remove them. Unfortunately, it's already been handed in so I can't implement your improvements, but thanks anyway. I'll be sure to bear this in mind in future.

9. 5 Cups of Ubuntu
Join Date
Apr 2005
Beans
22

## Re: Including eps in LaTeX file

Originally Posted by hod139
You can also produce pdf's directly using pdflatex
Code:
pdflatex integration_notes.tex
Note however, that pdflatex doesn't work with eps figures yet (technically it is still beta software.) You will have to convert all eps figures to pdfs using the command epstopdf. However, pdflatex will work with png's and jpg's which is really nice.
On The Mac latex port (Texshop etc) it deafults to pdflatex, and to get around the eps problem it defaults to including the package 'epstopdf' on it's standard document template - this automatically converts any eps files to pdf when the document is compiled. I haven't tested it on ubuntu but I imagine it would work the same.

10. hbj
5 Cups of Ubuntu
Join Date
Dec 2005
Beans
41

## Re: Including eps in LaTeX file

Have you tried using LyX? http://www.lyx.org/
It allows you to see things like eps figures and equations on the screen as you are working. Equation entry is especially nice - you just type things like you would in LaTeX and it does the formatting and displays the equation as you type. My students have learned to use it very quickly and one has written reports with over 100 pages. LyX handles it with ease and remains fast and responsive. Use the lyx-qt version. I highly recommend it.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•