[Tex/LaTex] Searching for Euro symbol

copy/pastedvi-modedvipsps2pdfsymbols

I found egreg's answer to the question "eurosym seems to not be working" some time ago and it works perfect if I compile using pdflatex, but if I compile using

latex
dvips
ps2pdf

the Euro symbol is not searchable in the PDF file. How do I make it searchable if I compile using the latter procedure?

Update

I'm wondering if anyone is trying to "make an up to date Type1 font version of feymr10.pfb with the correct glyph name (/Euro)" (quoting Heiko Oberdiek's last comment) at the moment?

Best Answer

As requested, an example using package accsupp that works for pdfTeX, the dvipdfm family (dvipdfm, dvipdfmx, XeTeX). In principle it could work for dvips, but from the documentation of accsupp:

1.3.3 Option dvips

Package option dvips and its alias dvipsone write pdfmark specials in the output. Unhappily these pdfmark operators are ignored by ghostscript (latest tested version is 8.54). Perhaps they are recognized by commercial distiller applications.

Nevertheless, the example file:

\documentclass{article}

\usepackage{eurosym}
\usepackage{amstext} % for \text
\usepackage{accsupp} % for PDF's ActualText feature

\DeclareRobustCommand{\officialeuro}{%
  \BeginAccSupp{%
    method=hex,
    unicode,
    ActualText=20AC,
  }%
    \ifmmode\expandafter\text\fi
    {%
      \fontencoding{U}\fontfamily{eurosym}\selectfont e%
    }%
  \EndAccSupp{}%
}

% \usepackage{hyperref}
% \pdfstringdefDisableCommands{\let\officialeuro\texteuro}

\begin{document}
\euro{} in text mode

$\euro$ in math mode
\end{document}

Remarks:

  • I have modified the first example of egreg's answer. In case of pdfTeX I would rather use the second example with the embedded font encoding to Unicode mapping.

  • A font with /Euro as glyph name instead of /e would be much better.

AFAIK the best strategy for copy/paste or searching would be:

  1. Font with correct glyph names.
  2. Font based Unicode mapping.
  3. ActualText feature (supported by AR, but not by all PDF viewers).