Graphics, Figures & TablesEPS and PNG Images in PDF File

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
icerose
Posts: 3
Joined: Thu Aug 11, 2011 1:14 pm

EPS and PNG Images in PDF File

Post by icerose »

Hi,
I have a heavy file with EPS and PNG figures. The below script is an example only for my problem. Here fig2.eps is actually PNG (cp fig2.png fig2.eps) because of that I use the bounding box. I have ran the script in Linux using the commands

Code: Select all

latex file.tex
dvipdf file.dvi file.pdf
The problem is fig2 cannot appear in the PDF file. I don't want to convert PNG to EPS (convert .png .eps) because it gives me bad figure with shadow. How can I get PDF file with EPS and PNG figures? Please don't read this without reply. Thank you very much.

Code: Select all

\begin{figure}[H]
\begin{minipage}{0.54\linewidth}
\centering
\includegraphics[scale=0.40,angle=0]{fig1.eps}
\end{minipage}
\hspace{-30 pt}
\begin{minipage}{0.54\linewidth}
\centering
\includegraphics[bb=0 0 640 460,scale=0.50,angle=0]{fig2.eps}
\end{minipage}
\end{figure}
Last edited by localghost on Thu Aug 11, 2011 6:21 pm, edited 2 times in total.

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

EPS and PNG Images in PDF File

Post by Stefan Kottwitz »

Hi,

I recommend using pdfLaTeX which directly supports PNG format. You can use EPS images if you convert them to PDF with tools such as epstopdf or by simply loading the epstopdf package which does conversion on the fly.
TeX Live 2010/11 can do the conversion automatically for you.

Stefan
LaTeX.org admin
icerose
Posts: 3
Joined: Thu Aug 11, 2011 1:14 pm

Re: EPS and PNG Images in PDF File

Post by icerose »

Thanks Stevan for your prompt reply. I have include
\usepackage{epstopdf} in my tex file and using pdflatex but gives me error: Unknown graphics extension .eps.?
How can i fix it?
icerose
Posts: 3
Joined: Thu Aug 11, 2011 1:14 pm

Re: EPS and PNG Images in PDF File

Post by icerose »

Ah. I got it. There was problem in the name of the figures.
Thanks Stevan again :D
Post Reply