Embed figures of eps format in LaTeX papers

Academic ,

Usually, I use xelatex to compile LaTeX files instead of latex, since the former one is able to generate PDF files directly with a faster speed and an excellent support for Chinese characters. However, recently I have no choice but to use latex again, since it is preferred by APS. Luckily, academic papers often does not contain Chinese characters, thus I don’t need to use the terrible CJK package again.

Now to generate a PDF format copy, the shell commands are

latex paper.tex;
bibtex peper;
latex peper;
latex paper;
dvipdfmx paper.dvi

But a new problem, which is about figures, emerges. APS recommends eps format for the figure files. But dvipdfmx does not support eps format. So I got blanks at the positions where the figures should be placed. Although dvipdfmx can not directly handle eps files, it can temporarily call Ghostscript to convert eps files into PDF format when generating the paper’s PDF copy. PDF format is supported by dvipdfmx. Unluckily, Ghostscript is generally not installed in OS X and I wasted a whole morning on struggling with the horrible blanks.

Installing Ghostscript is easy, just use homebrew:

brew install ghostscript

After that, parameter [dvipdfmx] is indispensable if the package hyperref is used.

\usepackage[dvipdfmx]{hyperref}

Certainly, PDF copy can be generated by other commands besides dvipdfmx. For example,

dvips paper.dvi
ps2pdf paper.ps

But you may get an ugly reference article list. :(