Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert EPS to PDF on the fly with pdflatex on the fly

Tags:

I'm trying to include an EPS figure in a document that will be compiled using pdflatex. Of course, the picture can be converted to pdf using epstopdf (which comes with the MikTeX distribution). Is there any way to do this on the fly, that is, make pdflatex do the conversion?

I'm looking for such a solution because I want to set up an easy-to-learn environment for students. Ideally, the converted picture is placed in the directory that also contains the original .eps, and the .pdf is used if available.

like image 338
Martijn Avatar asked Jun 30 '09 12:06

Martijn


People also ask

How do I use EPS with Pdflatex?

Simply include the package epstopdf . Then when you use pdflatex, the eps files will be automatically converted to pdf at compile time. (The conversion only happens the first time you process the file, and is skipped if there is already a pdf file with the same name.)

Can you turn PDF into EPS?

Convert PDF to High Quality EPS in Adobe on Windows & MacOpen PDF in Adobe Photoshop, choose to import as a page or image. Go to File>Save a Copy. Choose output as Photoshop EPS. Use the EPS Options to configure EPS settings.

How do I convert a file to EPS?

Go to File>Save as. Then choose EPS as the output and click Save. In the EPS option panel, configure the settings per your needs and click OK to export JPG as EPS in Adobe Photoshop.


2 Answers

The relevant answer in the TeX FAQ points to epstopdf.sty, included with Heiko Oberdiek's packages.

like image 101
Jouni K. Seppänen Avatar answered Nov 16 '22 09:11

Jouni K. Seppänen


I would recommend using latex-mk which is a nice way to have a very simple Makefile for latex construction. Of course you can have eps file converted to pdf, or fig to eps, etc, during the build process.

Currently my Makefile look like that :

NAME=report
TEXSRCS=report.tex
BIBTEXSRCS=biblio.bib
USE_PDFLATEX=true
VIEWPDF=open # cause i'm on osx, gv for most unix
XFIGDIRS=img

## For osx users :
include /opt/local/share/latex-mk/latex.gmk

## For unix users :
#include /usr/share/latex-mk/latex.gmk

When I invoke make, the first thing it does is converting some .fig into .pdf files. I'm pretty sure it would do the same with eps files.

like image 40
claf Avatar answered Nov 16 '22 09:11

claf