Wednesday, October 17, 2012

pdflatex vs pdftex

I have a document with lot of .eps figures embedded in it. These figures were of high quality but also large size. To cut down on the size I converted them to .png which were a tenth of the .eps format. Now using
latex file.tex (with eps figures)
worked well. But to use .png figures I thought I had to use pdftex.
pdftex file.tex (with png figures)
Turns out I should have used pdflatex instead. I ended up losing quite some time on this. The switch to pdflatex did the job and gave me a file which was a tenth of the original size. More on this from here:

"pdftex expects the file to be plain TeX. pdflatex expects it to be LaTeX. These
are two different dialects of TeX. You do not expect a C compiler to work with
Java, do you?

Note that in practice pdftex and pdflatex are often the same command, which
analyzes how it was called to switch to the proper input language. On some
systems gcc behaves in the same way, compiling C if it is called as gcc or
Fortran if it is called as gfortran."

Bottom line, figures can be heavily compressed by converting them to png format w/o a large loss in clarity; and pdflatex can handle png figures. Even if there is a loss of clarity, this is usually just fine for supporting information; maybe not so much for main article.

No comments:

Post a Comment