{copy-paste} is about copying text and other elements from one place (often a PDF file) and allowing it to be pasted. Searching for text (in a PDF file) is a process closely related to copying because both use the OCR (optical character recognition) layer in the PDF file.

learn more… | top users | synonyms

42
votes
7answers
17k views

Is it possible to produce a PDF with un-copyable text?

Is it possible to produce a PDF with un-copyable text? I mean, when you want to copy text from the PDF, you can't copy it or what you copy is nonsense characters.
66
votes
6answers
5k views

What are good ways to make pdflatex output copy-and-pasteable?

One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the ...
35
votes
2answers
676 views

Viewer-independent copyable spaces at the beginning of a line?

I need to include a couple of Python code listings, where the indentation of the lines (using some number of spaces) is significant. I would like for the code listings to be copyable, so the spaces at ...
35
votes
1answer
2k views

Make ligatures in Linux Libertine copyable (and searchable)

I'm currently working on an essay written in LaTeX form. I'm facing problems with ligatures - in my pdf output (rendered using pdftex) opened in Adobe Reader I get X's and V's when copy-pasting words ...
51
votes
1answer
3k views

Small-caps, old-style numbers, and some ligatures produce odd symbols in PDF copy text?

This is a problem I've had consistently with XeLaTeX. Here's a small example: \documentclass{article} \usepackage{fontspec} \setmainfont[Ligatures=TeX,Numbers={OldStyle,Proportional}]{Minion Pro} ...
22
votes
1answer
1k views

How to make text copy in PDF previewers ignore lineno line numbers?

I'm using lineno for a document. I have it configured to put line numbers in the margins of the document. I generate PDF using pdflatex. Here's the problem: when people copy a region of text in a ...
62
votes
3answers
2k views

Is there a LaTeX trick to prevent a PDF viewer from copying the line number?

A PDF output is obtained by compiling the following code. \documentclass{article} \usepackage{xcolor} \usepackage{listings} \lstset { language={[LaTeX]TeX}, numbers=left, ...
10
votes
3answers
4k views

How to make listings code indentation remain unchanged when copied from PDF?

So I am using listings package for code examples. But there is a problem. When I copy the code examples from the final PDF document, they are usually not the same - the indentation is gone, there are ...
124
votes
1answer
3k views

Making equations copyable in pdf

I would like to write a .pdf, where my readers could copy the rendered formulae and paste them directly in their TeX documents. And the copied text would automatically be: \int x\sin ...
26
votes
1answer
771 views

Is it possible to prevent some part of text (headers, footers) from selection?

I'm looking for a solution that will allow me to prevent some parts of the final pdf file (header, footer) from being selected and copied. It is to allow easier quoting of longer parts of texts from ...
11
votes
2answers
1k views

What can cause generated PDF document whose text are not correctly copyable?

I was wondering why some PDF documents compiled from some LaTeX code does not make its text correctly copyable, i.e. what you can get is nonsense text? For example, this pdf document (I don't have the ...
14
votes
2answers
916 views

How to fix missing or incorrect mappings from glyphtounicode.tex

glyphtounicode.tex has been described as the best solution for generating copy-and-pasteable symbols. However, I find that various symbols that I need to use do not paste as the appropriate Unicode ...
7
votes
1answer
3k views

Problem copying text from pdf - spaces being stripped

I have the following minimal working example: \documentclass{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \begin{document} é canção \end{document} I need to use the utf8 argument ...
13
votes
1answer
628 views

Can we make ligatures copy-and-pastable? [duplicate]

Is there a straightforward way to make ligatures more copy-and-pastable? I know that by using \usepackage[t1]{fontenc} that many glyphs like accented and umlauted characters become ...
8
votes
3answers
1k views

Problems with copy and paste from PDF using lstlisting

I'm using lstlisting to create course notes from which I am hoping that code can be copy&paste'd I've already implemented the suggestions in Phantom spaces in listings (pdf) to make sure that ...
5
votes
1answer
169 views

How can I preclude copying & pasting of listings?

When I include code snippets in my documents, my lazier readers, i.e. students :), are often tempted to just copy and paste those snippets instead of typing them themselves. However, there are risks ...
13
votes
1answer
376 views

Hyphens at end of line disappear upon pasting, even if they were present in the input

When I paste text from pdflatex output, there are two things about hyphens that I would like to change: Hyphens paste as "hyphen-minus" (U+002D, "-"), but I would prefer the newer Unicode character ...
4
votes
1answer
574 views

How to copy contents of one file to another?

So I have a .txt-file and I need to import the data line per line. That works like it should. I need however to adapt the contents loaded into a command an write it to another .txt file that later ...
8
votes
3answers
1k views

Incompatibilities of cmap with fontenc/hyperref?

The following code doesn't compile (with pdflatex) \documentclass{article} \usepackage{cmap} \usepackage[T1]{fontenc} \usepackage[pdfa=true]{hyperref} \begin{document} Hello. \end{document} ...
3
votes
1answer
119 views

How to copy/paste multiple spaces from lstlistings?

This is a continuation of a question that I asked already: How to copy/paste from lstlistings?. The solution presented there does not work if the text within the lstlistings environment contains ...
1
vote
1answer
193 views

How do I paste codepoints outside of the basic multilingual plane with accsupp or \pdfglyphtounicode?

As described in the answers to this question, the accsupp package can be used to have symbols paste as arbitrary Unicode codepoints. For example you might want to write something like the following, ...
28
votes
1answer
766 views

Make hyphenated words in PDF searchable

Is there a way to make hyphenated words in a PDF generated by LuaTeX searchable? If the MWE below is converted to a PDF, searching for "lexicon" (in Acrobat X for example) will not find the word since ...
12
votes
1answer
7k views

Protect text in PDF from being copied [duplicate]

Possible Duplicate: PDF with un-copyable text What is the most effective ways to protect text in a PDF from being copied with Ctrl+C? I know about standard PDF copy protection, and also ...
10
votes
2answers
656 views

pdf files show “fi”, but searching for or copying them does not work

When I pdflatex text containing "fi", e.g. "infinite", the resulting pdf-file looks correct, e.g. "infinite" is shown in the text. But when I search the pdf file for "infinite", 0 occurrences are ...
8
votes
1answer
403 views

How can I make source code included with minted copyable?

Is it possible to make source code with minted copyable? Here is a minimal example how I include source code (completely, with minimal java code, on GitHub): \documentclass{beamer} ...
6
votes
2answers
2k views

Copy-pasting leading whitespace and blank lines in listings package (pdf) [duplicate]

I'm trying to use the listings package to typeset some code in a PDF document, in a way that allows me to copy-paste the resulting code. This mostly works well, if ...
8
votes
1answer
779 views

Copying LaTeX from a PDF

Is there a way to copy from a PDF to a LaTeX document? Whenever I do it, it copies in with weird symbols in the place of LaTeX commands for example: $$f:\mathbb{R}\rightarrow \mathbb{R}$$ copies in ...
15
votes
1answer
1k views

Remove hyphen from word spanning two lines in text copied from a pdf file

If I copy text from a PDF and a word is hyphenated and spans two lines, the copied text contains the "-". For example: Examp- le should be copied as Example not Examp-le The problem is ...
13
votes
2answers
367 views

How to produce character-by-character-pastable visual output that is a function of the (intended-to-paste-as-such) source code input?

Note: The original phrasing of my question was this: How to use accsupp to produce all-upercase in the visual output from input that should paste in its original, ordinary-case form? However I think a ...
9
votes
2answers
170 views

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 ...
6
votes
2answers
14k views

How to make apostrophes appear normally when copy-pasting from a MS Word document?

I have a report written in MS Word which I would like to turn into a LaTeX document. I copy-pasted the content of the document in my LaTeX editor (TeXShop, LaTeX, pdfTeX) and everything comes out fine ...
5
votes
0answers
299 views

Copy to clipboard feature in PDF output

I want a clickable copy to clipboard feature in my PDF document. Ideally the macro also allows for graphical elements to be embedded inside them (say, a button that will automatically copy paste ...
5
votes
1answer
1k views

How to make slash (/) paste with correct Unicode codepoint depending on context?

Unicode offers different characters for the slash: U+002F (/) for the ordinary slash U+2215 (∕) for the mathematical division operator U+2044 (⁄) to designate vulgar fractions How can I have these ...
11
votes
1answer
248 views

Make a command to mark a text and class them for text analyze

Sorry for my English, I'm French and it's my first post on this forum, but I'm a frequent visitor of this forum, thanks for all ;) My problem is this : I'm working with transcriptions of 35 ...
7
votes
1answer
291 views

Copy Czech characters from PDF with charter font

I wanna be able to copy czech characters from PDF, but for some reason it doesn´t work. here is my code: \usepackage{cmap} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{charter} ...
5
votes
1answer
571 views

How to copy/paste from lstlistings? [duplicate]

I'm trying to write code in a LaTeX document that can be copy/pasted from an outputted pdf using Adobe Reader and that also word wraps, rather than breach the right margin. I've found that in ...