HOME - Recent Changes - Search:

Academic Work


Personal

* pot de départ


dblp


(:twitter:)

-----

[ edit | logout ]
[ help | sandbox | passwd ]

epstopdf AND latex-pdflatex

#############################

Problem

Until now I have always used the command latex for compiling .tex files. Then the chain of conversion was the following: .dvi → .ps → .pdf. However, once I had to validate the PDF of a final paper, and I got a nice list of errors claiming that several fonts are not embedded in my pdf. Whadda?

Solution

Instead of latex it's time to change to pdflatex. However, there are some questions that arise:

  • I use Visio 2000 to create my figures. I prefer .eps because it's a very nice vectorial format that produces beautiful output. I hate .jpg and .png. Ugly. There is only one solution: .eps files must be converted to .pdf, which is acceptable for pdflatex.
  • Visio 2000 is a very nice software, but its EPS converter produces strange output. Some programs can read it without any problem, but some programs complain of errors. Under Linux there a nice utility for this problem: eps2eps (from the text/gs-common package).
  • OK, now we have a correct .eps file. At the following address one can find a nice utility called epstopdf. I tried other converters, but none of them respected the size of the .eps file. Fortunately, this one works as it is expected. Under Windows I use Cygwin. The script checks the environment and modifies the path of Ghostscript according to this. I think it's a little bug that it doesn't use the correct name in the case of the Cygwin environment. I modified the script a bit, so here is the corrected version. This one is tested under Linux and Cygwin.

Converting .eps to .pdf correctly

  • Use eps2eps (necessary if your .eps files are corrupted) in the package text/gs-common.
  • Use epstopdf to convert a corrected .eps to .pdf. [ original version, Jabba's patched version for Cygwin ].
  • eps2pdf is a simple wrapper. First, it calls eps2eps, then it executes epstopdf on the correct .eps file.
  • eps2pdf_all is a script that executes eps2pdf in the current directory recursively. Idea: when I work with LaTeX, I put all the images in a subdirectory called assets. It contains all the .eps files. This script can be put in the assets directory, and whenever an .eps file is modified, it is sufficient to execute eps2pdf_all and it will convert all .eps files to .pdf.

A combined solution: either latex or pdflatex

I find that .ps files still have several advantages, so I don't want to just forget them. I want to keep the possibility to choose which compiler to use: latex or pdflatex.

  • Here is an example code (latex_or_pdflatex.tex). Paste it at the beginning of the LaTeX source. You must use it with one of the batch files below (since these batch files will modify the contents of the config file that will be included in the source).
  • compile_latex: a batch file for compiling with latex
  • compile_pdflatex: a batch file for compiling with pdflatex

Advantage: you only have to run the appropriate batch file. The source file needs no manual modification!

Important: keep your images in two formats: .eps for latex, and .pdf for pdflatex. Conversion from .eps to .pdf is explained above.

Cloud City


anime | bash | blogs | bsd | c/c++ | c64 | calc | comics | convert | cube | del.icio.us | digg | east | eBooks | egeszseg | elite | firefox | flash | fun | games | gimp | google | groovy | hardware | hit&run | howto | java | javascript | knife | lang | latex | liferay | linux | lovecraft | magyar | maths | movies | music | p2p | perl | pdf | photoshop | php | pmwiki | prog | python | radio | recept | rts | scala | scene | sci-fi | scripting | security | shell | space | súlyos | telephone | torrente | translate | ubuntu | vim | wallpapers | webutils | wikis | windows


Blogs and Dev.

* Ubuntu Incident
* Python Adventures
* me @ GitHub


Places

Debrecen | France | Hungary | Montreal | Nancy


Notes

full circle | km


Hobby Projects

* Jabba's Codes
* PmWiki
* Firefox
* PHP
* JavaScript
* Scriptorium
* Tutorials
* me @ GitHub


Quick Links


[ edit ]

View - Edit - History - Attach - Print *** Report - Recent Changes - Search
Page last modified on 2007 July 27, 14:47