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:
- Font with correct glyph names.
- Font based Unicode mapping.
- ActualText feature (supported by AR, but not by all PDF viewers).
accsupp
:)
It is beyond my (La)TeX skills.accsupp
says that the marks it uses are not recognized by Ghostscript.feymr10.pfb
with the correct glyph name (/Euro
) ...