0

The issue

I compile a latex document which contains accents ("é" for instance), then I copy the text from the pdf generated by pdflatex. Then, I paste this text to my latex file.

The resulting file cannot be completed, for some encoding reason.

Is there a way to solve this problem?

PS:

My system is OSX. My TeX distribution is TeXLive. My PDF previewer is Preview (the default Apple previewer application).

PPS:

This problem seems to be related more to Apple's Preview application than anything else.

Minimal non-working example

\documentclass{article}

\usepackage{cmap}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}

Copy this text "éàoùôêèç" and then paste it here : éàoùôêèç

Then compile again.

\end{document}

The error

./Sans-titre.tex:10: Package inputenc Error: Unicode char \u8:Ì not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H for immediate help. ...

                                               l.10 ... oùÎêÚç" and then paste it here : eÌ
                                              aÌouÌoÌeÌeÌç

enter image description here

  • 1
    Works fine for me (with and without cmap) on windows and sumatra or adobe reader. – Ulrike Fischer May 6 '14 at 11:33
  • My system is OSX. My TeX distribution is TeXLive. My PDF previewer is Preview (the default Apple previewer application). – Colas May 6 '14 at 11:58
  • 1
    Imho Apple decompose sometimes the glyphs in char+combining accent when you copy & paste. If you don't have this problem when you copy from other pdf's then it is perhaps due to the glyph names. You could then try \pdfglyphtounicode to change them. tex.stackexchange.com/a/4398/2388. – Ulrike Fischer May 6 '14 at 12:09
  • Yes, it works with Acrobat Reader. – Colas May 6 '14 at 12:23
  • I am using \input glyphtounicode \pdfgentounicode=1 when I am using the IL2 font encoding, or, I am using xelatex and lualatex engines without the inputenc package (I am using fontspec instead). – Malipivo May 6 '14 at 12:26
1

This problem comes from Apple's Preview application up to OS X 10.9. I have not tested on newer versions.

See there.

  • 1
    You should provide some more detail here. Plus it can be argued that you're not really answering your own question here, since discovering that the problem lies with Preview is not a solution. – Sverre Sep 17 '15 at 21:25

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.