8

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?

  • 1
    Good question. I don't know at all. Maybe some trickery with accsupp – egreg Jul 22 '13 at 21:37
  • @egreg Maybe :) It is beyond my (La)TeX skills. – Svend Tveskæg Jul 22 '13 at 21:53
  • Unfortunately the documentation of accsupp says that the marks it uses are not recognized by Ghostscript. – egreg Jul 22 '13 at 22:01
  • @egreg That is a shame, but thank you for letting me know that it cannot be fixed. (If you make the comment into an answer, I'll accept it.) – Svend Tveskæg Jul 22 '13 at 22:13
  • 1
    @egreg: Someone could make an up to date Type1 font version feymr10.pfb with the correct glyph name (/Euro) ... – Heiko Oberdiek Jul 22 '13 at 22:58
6

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).
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.