[Tex/LaTex] pdf files show “fi”, but searching for or copying them does not work

copy/pastefontsligaturespdftex

When I pdflatex text containing "fi", e.g. "infinite", the resulting pdf-file looks correct, e.g. "infinite" is shown in the text. But when I search the pdf file for "infinite", 0 occurrences are found. When I copy "infinite" and paste it, the result is "innite". Searching for "innite" results in 0 occurrences as well.

What causes this behavior? My font not being able to handle ligatures? How can I fix it, such that "fi" is treated the same as any other letter combination?

Best Answer

LaTex use ligatures in the text and the PDF-readers treat that as one, unknown character. As far as I remember, I solved the same problem by adding the following two lines in the preamble:

\input{glyphtounicode}
\pdfgentounicode=1

I found this solution in the MinionPro manual, page 7.

I use utf8 encoding in my document, i.e.

\usepackage[utf8]{inputenx}
\usepackage[T1]{fontenc}

Also have a look at Ulrike Fischer’s answer to a similar question regarding Linux Libertine.

glyphtounicode was included in the MiKTeX-distribution I use, but if it is not included in yours, you can find it at Sarovar.

Related Question