4

This is either a question or an encouragement, depending on the situation. If a pdf typeset with latex and made into a pdf with ps2pdf contains the word "final", searching for that word in the pdf with Acrobat Reader yields no hit.

The reason is that the pdf file is typeset with a "fi" ligature, and the search algorithm does not know that "final" should also search for the "fi" ligature. On the other hand, if the same ps file is distilled with Acrobat Distiller, the search works. Distiller somehow is more capable.

Can this be achieved with ps2pdf already now (it was not possible a few years ago)? Or will it be possible at least one day in the future?

I use the newest 2014 texlive distribution, OSX, the MinionPro font and package with T1 fontenc and utf8 inputenc, the Myriad font, 50 other packages, and work along the dvi -> ps -> pdf route. This is the minimal example:

\documentclass{book} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{MinionPro}
\begin{document}
Almost final.
\end{document}

By the way, this MinionPro problem is indeed solved with glyphtounicode.tex for MinionPro if the dvips/ps2pdf route is avoided, and the pdf is produced directly. The problem only appears if intermediate postscript is produced. Therefore another way out, in principle, would be to find successor packages for pstricks and psfrag, which also allow to use my hundreds of eps images, and that work with pdflatex. However, the package experts explained that this is not possible yet.

Henri Menke
  • 109,596
  • If I compile \documentclass{article}\begin{document}final\end{document} with latex-dvips-ps2pdf, the search for final in Adobe Reader is successful. – egreg Jan 22 '15 at 17:16
  • I added a minimal example that shows the problem. It seems font-dependent. –  Jan 22 '15 at 17:22
  • Section 7 of the Minion Pro package manual indicates you might fix this with \input glyphtounicode \pdfgentounicode=1. Does that work? – Mike Renfro Jan 22 '15 at 17:34
  • No, I tried it. –  Jan 22 '15 at 17:37
  • Related, may help: What are good ways to make pdflatex output copy-and-pasteable? -- since I don't have MinionPro, I can't make a useful test. – Mike Renfro Jan 22 '15 at 17:47
  • Where can one find the latest version of glyphtounicode.tex? –  Jan 22 '15 at 17:52
  • It tried this with the following packages (with the words "final efficient flat") and all were searchable using the evince viewer on Debian: default Computer Modern, libertine, ebgaramond, concmath. – musarithmia Jan 22 '15 at 17:53
  • 1
    glyphtounicode.tex is distributed with pdftex as part of the TeXLive distribution. In a standard installation on Linux it is at /usr/local/texlive/2014/texmf-dist/tex/generic/pdftex/glyphtounicode.tex. – musarithmia Jan 22 '15 at 18:01
  • 2
    Why do you need the dvi -> ps -> pdf route? Can you not use pdfLaTeX or XeLaTeX instead? – karlkoeller Jan 22 '15 at 20:03
  • I need the ps route because I use pstricks, psfrag and eps images. In the meantime I tried with the official version of glyphtounicode.tex, but it does not work. And the problem is clearly font-dependent. I need a solution that works for MinionPro. –  Jan 22 '15 at 20:54
  • LuaTeX? Why do you have to use MinionPro? – cfr Jan 23 '15 at 01:59
  • The LaTeX style file is 5000 lines long. Changing to LuaTeX seems a big project and might well be impossible. MinionPro is a given part of the book design; see www.motionmountain.net . –  Jan 23 '15 at 04:47
  • A way out may be to find an old version of Acrobat Distiller (8 or 9) for OSX 10.6.8 for free download. But as far as I know, it is not available for free - nor even for money. –  Jan 23 '15 at 04:52
  • 1
    I don't know, but I think I've read that auto-pst-pdf is a package which lets you use pstricks and so in pdfLaTeX. Doesn't it work in this case? – Manuel Jan 26 '15 at 13:32
  • Neither auto-pst-pdf nor its successor pstools solve the issue. –  Jan 30 '15 at 06:28
  • See also the related comments by the Gostsript/ps2pdf team at http://bugs.ghostscript.com/show_bug.cgi?id=695806 Maybe the mentioned "Tounicode" issue can be addressed in dvips? –  Jan 30 '15 at 08:56
  • Works fine in Okular, too, even with the latex -> dvips -> ps2pdf route. Find highlights 'final' OK. This is with MinionPro. So it isn't clear to me that this is ghostscript's fault. Unless it is an interaction with a particular version of the font. Or unless it is an Adobe-specific issue. – cfr Jan 31 '15 at 04:46
  • Do you find "final" with Adobe Reader in your pdf file? –  Jan 31 '15 at 17:13

1 Answers1

4

In the meantime, the maintainers of ps2pdf/ghostscript have explained in detail at bugs.ghostscript.com/show_bug.cgi?id=695806 (where the question was also posted) that ps2pdf could in principle be expanded to allow such a search, but that the solution would take a large amount of work and produce only little benefit to the end user. Therefore the ps2pdf team will not implement it.

Therefore, the answer to this question is: Not in the foreseeable future.