[Tex/LaTex] XeTeX and graphicx: characters missing in .eps

epsfontsgraphicsxetex

I'm trying to include an .eps in a XeTeX file I am working on. The eps file contains an image and some painstakingly-spaced text labels. For some reason, however, some of the characters in the text do not show up. I've scoured the internet, and tried recreating an example using pdfTeX instead, and it's clearly a XeTeX issue. Not using XeTeX is not an option.

Basically, the image shows up fine, but the text is missing — with the exception of the square brackets around the text, and certain special characters in the IPA. So if I have the text [dum] it shows up as [ ]; if I have [dɨm] it shows up as [ ɨ ], [dʉm] shows up as [ ʉ ], and so forth. The font of this text is not the main font I'm using in the document – it looks to me like it might be Computer Modern, but it's hard to tell from just one character.

Here is a MWE, compiled with xelatex:

\documentclass{article}
\usepackage[xetex]{graphicx}
\begin{document}
\includegraphics{image.eps}
\end{document}

If I run the exact same code, minus the [xetex] option in graphicx, using pdfLatex, the eps shows up just fine!

What might be causing this? Any suggestions are welcome.

Best Answer

XeTeX can't include EPS files directly, so the driver program converts them to PDF beforehand. The conversion command by default is

ps2pdf -dCompatibilityLevel=%v -sPAPERSIZE=a0 -dAutoFilterGrayImages=false
  -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false
  -dColorImageFilter=/FlateEncode %i %o

(From dvipdfmx.cfg.)

In case it does not work, a manual conversion can be tried, either by using epspdf or another program.

Don't ask me what's wrong with the default command, though :-) My guess is that it's meant to handle PS and not EPS (Encapsulated PostScript) formats.