Graphics, Figures & Tablespdflatex eps and including pdfs

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ender
Posts: 2
Joined: Wed Dec 02, 2009 1:34 am

pdflatex eps and including pdfs

Post by ender »

Hi guys

I am new to LaTeX and started writing my thesis with it. It initially seemed sooooo good (i found it more reliable then Word).

But I have hit a wall. My friend told me that the best way to add graphs was to include them as eps files. No problems. And i appreciate that now i have to

latex file.tex

dvips -t a4 thesis.dvi -o thesis.ps

ps2pdf thesis.ps thesis.pdf

But now i need to append an entire pdf document to the back of my document. I googled it and found includepdf. The problem is now I need to pdfLaTeX. And I know I cant because of the eps files.

What does one do...?

Thanks for any help, Ciao

Recommended reading 2024:

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

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

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Re: pdflatex eps and including pdfs

Post by fatra2 »

Hi there,

Your friend is partly right. Encapsulated PostScript are the defacto for LaTeX, but only when you comile in .dvi format. Therefore, if you want your figure/graph to appear, you will have to compile to dvips and then transform the .dvi file into a .pdf.

Otherwise, if you want to compile directly in .pdf format, pdflatex does not seem to recognize the .eps format. Therefore, your figure file should be .jpg, .gif, .png or other format of figure format. The best way that I found to make sure the figure is included is by having two figure file, .eps and .jpg. In your code, you only need to \includegraphics[width=0.75\textwidt]{your-file} without the extension. The compiler, either dvips or pdflatex, will take the format necessary.

Hope this helps. Cheers
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pdflatex eps and including pdfs

Post by localghost »

fatra2 wrote:[…] Therefore, your figure file should be .jpg, .gif, .png or other format of figure format. […]
The GIF file format is not a valid format for pdflatex. This compiler engine accepts JPG, PNG and PDF. Former versions of pdftex accepted the TIFF file format, but this feature has been removed.
ender wrote:[…] My friend told me that the best way to add graphs was to include them as eps files. […]
You can convert your EPS files to PDF either with the command line tool epstopdf or "on the fly" with the epstopdf package. Please use the forum search for appropriate solutions.


Best regards and welcome to the board
Thorsten¹
ender
Posts: 2
Joined: Wed Dec 02, 2009 1:34 am

pdflatex eps and including pdfs

Post by ender »

Thank you Thorsten and fatra2,

I appreciate all your help. I initially tried the

epstopdf file.eps

in the command window for some of the document and that worked perfectly. (thanks again :))

This next bit might sound really stupid... When I attached all the chapters I found another problem. I use pstricks to generate some simple graphs, plots and web diagrams. These result in errors and pdflatex not working. is my best bet to create a time machine and change how i created these or is there an equally simple user friendly means of working around. I did try to google it myself and found PSforPDF and pst-pdf but cant make them work.

Cheers
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

pdflatex eps and including pdfs

Post by frabjous »

Ender,


Ths PStricks packages do not work with pdflatex, no.

Thorsten asked you to use the forum search for a reason. This topic comes up a lot on these forums, and there's lots of discussion on it. See if you can find an answer.

There's another possible solution to your original problem, which would be to make your main PDF the way you had been before with latex, dvips and ps2pdf to get a PDF, and then use the pdfpages package to combine both PDFs into one fle.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pdflatex eps and including pdfs

Post by localghost »

ender wrote:[…] This next bit might sound really stupid... When I attached all the chapters I found another problem. I use pstricks to generate some simple graphs, plots and web diagrams. These result in errors and pdflatex not working. is my best bet to create a time machine and change how i created these or is there an equally simple user friendly means of working around. I did try to google it myself and found PSforPDF and pst-pdf but cant make them work. […]
Now you see me very confused. You want to to insert EPS graphics and you want to use pstricks for your diagrams. I wonder why you insist on compiling directly with pdflatex. Using the compiling route »LaTeX -> DVI -> PS -> PDF« would be more logical in this case. You could use the (auto-)pst-pdf package for direct compilation. But it would save a lot of time to use the other route. The forum search will yield suitable solutions for this problem, too.
Post Reply