[Tex/LaTex] Can PDF search find words with ligatures in XeLaTeX-documents

copy/pasteligaturespdfxetex

Is there some way allow PDF search to find words with ligatures? I use XeLaTeX.

\documentclass{book}
\begin{document}
Prefix.
\end{document}

In the resulting pdf file, searching for the word "Prefix" fails.

Best Answer

Add \usepackage{fontspec}. This actually loads the package fontenc, which would solve your problem for pdfLaTeX.

As a result, the ec fonts are loaded instead of the standard Computer Modern fonts, as Ulrike remarked in the comments. For other fonts, other solutions might apply; this answer addresses a standard setup as seen in the OP's MWE.

Related Question