1

I have old style figures enabled globally with kpfonts. However, numbers are represented as special unicode characters from the point of view of copy-paste or search. I would like them to function as normal digits instead.

Minimal example:

\documentclass{article}
\usepackage[oldstylenums]{kpfonts}
\begin{document}
0123456789
\end{document}

Copy-paste gives '' instead of '0123456789'. I'm hoping there's a way to fix this globally without having to add a command to each number in the document.

3

You can map the names used by the kpfonts to the unicode positions of the digits:

\documentclass{article}
\usepackage[oldstylenums]{kpfonts}
\pdfglyphtounicode{zerooldstyle}{0030}
\pdfglyphtounicode{oneoldstyle}{0031}
\pdfglyphtounicode{twooldstyle}{0032}
\pdfglyphtounicode{threeoldstyle}{0033}

\pdfgentounicode=1
\begin{document}
0123
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.