[Tex/LaTex] How to encode foreign characters so that they are searchable in the resultant PDF file

accentscopy/pastefont-encodingspdfpdftex

This may be a PDF problem rather than a LaTeX problem, but as it involves pdfLaTeX output I'm hoping I won't get my wrist slapped too hard.

I'm creating a bibliography, and inevitably some of the authors' names have accented or other foreign characters in them. I'd like to be able to search the PDF file for these authors, but I'm having problems with some of the characters. As an example, I've created a simple .tex file as follows:

\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
Some foreign characters: öøäéüæåñ
\end{document}

I can search successfully in the resultant PDF file for ö, ä, é, ü, å and ñ, either using those specific characters or an unaccented o, a, e, u or n. However, the PDF file will not find the ø or æ characters whether I copy and paste them into the search box from another programme, or whether I use Alt+155 or Alt+145. The problem is compounded by the fact that some journals use a simple 'o' for ø or 'ae' for æ, so I'd like to get a search 'hit' for ø using either ø or o, and similarly a search hit for æ using either æ or ae. Is any of this remotely possible, or am I trying to be too clever?

Best Answer

Can you try:

\usepackage[T1]{fontenc}

Full test document:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
Some foreign characters: öøäéüæåñ
\end{document}
Related Question