How to insert searchable value for PDF reader?

In a dictionary a headword can consist of special characters like in this example : Eyja·fjalla··jök|ull. I would like to achieve that the user in PDF reader in PDF file can search for Eyjafjallajökull (the headword without the special characters).

Very naive, but easy to generalize. Final definition should have two parameters and take maximum of two lengths.

\documentclass[11pt]{article}

\usepackage{color}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\newlength\eyja
\settowidth{\eyja}{Eyjafjallajökull}
In a dictionary a headword can consist of special characters like in this example
\makebox[\eyja]{\color{white}Eyjafjallajökull}\hspace{-\eyja}Eyja·fjalla··jök|ull.
I would like to achieve that the user in PDF reader in PDF file can search for
Eyjafjallajökull (the headword without the special characters).

\end{document}


Alas, I cannot add the resulting PDF here. Tested only under Acrobat Reader.

Updated: - Preview in Evince.

• Works in Sumatrapdf. – azetina Dec 11 '13 at 22:00
• It works in Evince too. If I understand it correctly, I should set the width each time new headword appears, so the box corresponds to the width of the headword. – chejnik Dec 12 '13 at 7:28
• If you just want searchable and are okay with the headword being slightly off (in terms of the highlighted parts when you search), you can just use \rlap{\color{white}Original Word}Head-word-with-symbols instead of the \makebox incantation. This way you also don't need to measure the lengths. – Willie Wong Dec 12 '13 at 14:29
• It does not work in Adobe Reader. – chejnik Dec 19 '13 at 13:58

accsupp does allow for this:

\documentclass{article}
\usepackage{accsupp}% http://ctan.org/pkg/accsupp
\begin{document}
\BeginAccSupp{ActualText=Eyjafjallajokull}
Eyja$\cdot$fjalla$\cdot\cdot$j{\"o}k$\vert$ull
\EndAccSupp{}
\end{document}


While the selection might not be as expected, the search works (in Adobe Reader, at least).

• Does not seem to work in Sumatrapdf. – azetina Dec 11 '13 at 22:01
• @azetina No, only Adobe Reader supports it, AFAIK. – egreg Dec 11 '13 at 23:57