LaTeX: include eps files in pdflatex

My problem is I have several image files that are in .eps format.

I need to include these images inside a .tex file and then compile it by pdflatex to create a pdf file.

I already knew that if I compile my .tex file using pdflatex it will give me an error because it doesn’t support .eps graphics but only jpeg, png, pdf…

After some search on the net I found an online solution. In this website you can upload your .eps files and as a result you will have your converted .pdf files to download and to use in your .tex file.

The only disadvantage about this online solution is that if you have a lot of files you need to convert, you will have to stay there to upload one by one because it doesn’t support multiple files.

So the next solution is what I prefer.

You need to declare these two package in your preamble:


then you can include .eps files as any other simple images:


The trick is that when you are compiling by using pdflatex it will check if the corresponding pdf version of the file exists or not. If it does, it will simply use the pdf version, otherwise it will convert the eps version to a pdf version and then use the pdf file.

NB: To compile the .tex file you need to add “-shell-escape” in your command of pdflatex:

pdflatex -shell-escape name_file.tex



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: