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.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIs 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.
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.
fontspec
you are using a different font which uses correct glyph names and so allow the pdf reader to "understand" the ligature. \usepackage[T1]{fontenc}
(which switches from the cm fonts to the ec fonts), \usepackage{lmodern}
or \usepackage{times}
work too.
Aug 20, 2012 at 8:37