Graphics, Figures & TablesHow do I: Compile to PDF when I have .eps and .png images

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

How do I: Compile to PDF when I have .eps and .png images

Post by Eenzc »

I have a document that I would like to include .png and .eps images in.

I use graphicx to show my .png images.

I have tried to include an .eps figure using epsfigure but it won't have it.


If I compile my document to ps then pdf it complains that my .png images dont have bounding boxes.

Is there a simple way around this or should I just not bother with .eps figures... I have over 100 figure in .png and I don't feel like converting them all to .eps and changing all my graphicx code to epsfig code. Like wise I'd rather not convert my .eps files to .png if I can help it.

Thanks,

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10344
Joined: Mon Mar 10, 2008 9:44 pm

How do I: Compile to PDF when I have .eps and .png images

Post by Stefan Kottwitz »

Hi Eenzc,

I recommend to use epstopdf to convert the eps images to pdf format and use pdfLaTeX to include pdf and png images. The LaTeX package epstopdf could make that easier.

Stefan
LaTeX.org admin
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Re: How do I: Compile to PDF when I have .eps and .png images

Post by Eenzc »

The epstopdf package requires that I enable shell escape however I am using TeXnic centre to compile to pdf and do not use a command line to compile.

Thus I don't know where to enter the command:

--enable-write18

Thus it won't convert my .eps file.

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

Re: How do I: Compile to PDF when I have .eps and .png images

Post by localghost »

Start TeXnicCenter (TXC), press Alt+F7 and add this switch to the command line arguments for the compiler. The best is to do that for every profile.


Best regards
Thorsten¹
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Re: How do I: Compile to PDF when I have .eps and .png images

Post by Eenzc »

Thank you this works.
Post Reply