1
\documentclass[12pt,a4paper]{article}
\usepackage[noTeX]{mmap}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\begin{document}
$(A\to B)\vdash B$
sample text
\end{document}

The text copied from the resulted pdf is not pasted correctly. It pastes only math signs and brackets, letters are pasted as some unicode characters: ( � → � ) ⊢ �.

As egreg pointed out letters are interpreted as MATHEMATICAL ITALIC CAPITAL characters.

If I remove \usepackage[noTeX]{mmap} then it will be shown almost correctly in common editors (notepad++, notepad): "( A → B ) ` B sample text", turnstile symbol becomes a backtick.

How to make this work correctly?

3
  • 1
    If I try your document, the “A” is interpreted, on copying, as U+1D434 MATHEMATICAL ITALIC CAPITAL A and similarly for the other letters. If your editor has no font substitution capability, it won't display those symbols unless you set the editor's font to one that supports those characters, such as FreeSerif. I copied it in Emacs and the characters were shown. – egreg Dec 11 '14 at 16:34
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – cfr Dec 11 '14 at 22:37
  • I get the wrong characters with Adobe Reader, not with other PDF viewers. – egreg Dec 12 '14 at 17:58
1

You can apply the method in this answer

\input{glyphtounicode}
\pdfgentounicode=1

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\begin{document}
$(A\to B)\vdash B$
sample text
\end{document}

I show here what I get from copying in Adobe Reader:

(A → B) ⊢ B sample text

Other PDF viewers (Skim, for instance) work without those two lines of code.

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.