[Tex/LaTex] Disappearing Euro symbol in MATLAB EPS plots

epsgraphicsMATLABsymbols

I have a problem using eps images in LaTeX.
Briefly, I have a plot from MATLAB were a label on an axis is "€". I insert this image in my tex file, then, when I compile, on the pdf the "€" disappear.
Is it a problem of MATLAB images or EPS can't handle "€" symbol? Or maybe another reason?

Best Answer

It's a Matlab problem, mixing up encodings, and it doesn't have anything to do with LaTeX.

Matlab supports Unicode internally, including displaying Unicode symbols in plots, but as far as I can tell you cannot generate eps files containing them.

In particular, the UTF-8 code of a symbol is written by Matlab as an octal escape sequence to the eps, for "€" e.g.

\342\202\254

At least on my Linux system, the € doesn't just disappear, but in an eps previewer like Okular it shows up as "â ¬". This indicates that the three codes are interpreted separately, as ISO-8859-1 codes.

I don't know enough about PostScript to tell you whether it is even possible to use Unicode / UTF-8 in an eps file (and therefore laziness on part of TMW) or not. Since you are using LaTeX, a workaround would be to use psfrag which allows you to include LaTeX code within an eps file and then get it replaced by a rendered version upon inclusion in LaTeX. For the € symbol, you can use e.g. the \euro command provided by the eurosym package.