Linked Questions

55
votes
1answer
3k views

Is it possible to provide alternative text to use when copying text from the PDF?

I’m using XeLaTeX within MiKTeX and have the following problem. Let there be some acronym, e.g. USA. I would like to write it in real small caps using \textsc{usa} but these are, of course, lower-...
21
votes
2answers
1k views

Techniques to make tabular contents copyable

Take the following table: \documentclass{article} \begin{document} \begin{tabular}{|c|c|} 11 & 21 \\ 12 & 22 \\ \end{tabular} \end{document} What are the techniques to make this table text-...
16
votes
1answer
5k 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 ...
7
votes
1answer
980 views

produce copy-paste-able pdf output with correct indentation with listing

Here is a block of latex code to produce some Python code. I'd like to be able to copy and paste it into Python. \documentclass{standalone} \usepackage{listings} % Include the ...
4
votes
1answer
588 views

How to have free accents in `lstlisting`

There are quiet some questions about getting accents like è into the lstlisting environment. But I actually want to have a free floating accent. However, Latex always changes it to some other symbol ...
2
votes
2answers
1k views

Unwanted space around punctuation in copied & pasted listing

When I compile the .tex file below into .pdf using rubber -d mwe.tex and try to copy & paste the contents of the listing, I get spaces around . characters that were not present in the original ...
1
vote
1answer
657 views

how to wrap a long terminal command without real line breaking?

this may look like a duplicate question to this one and many, but really I had a hardtime in finding the desired solution. The breaklines=true didn't work as it breaks the long command. Hence simple ...
1
vote
1answer
681 views

LaTeX symbol for single quote mark that MATLAB will recognize

I'm writing MATLAB code in LaTeX and I would like to be able to cut and paste it directly into the MATLAB command window. One critical symbol is the ' (single quote). When processed by LaTeX it shows ...
3
votes
0answers
485 views

Listing cut and paste in PDF

I am trying to get good copy-n-paste'able text from a LaTeX generated PDF using the listings package. I have three listings that all behave not as I'd like: Long lines are broken using breaklines ...
2
votes
0answers
478 views

Is it possible to get the leading spaces in copy/paste from PDF?

Using this solution Only Select Code without Line Numbers I allow the listings to be copyable from PDF w/o the line numbers and many extra spaces. But that also removes the leading spaces used for ...
1
vote
0answers
32 views

Get source code as it is from output [duplicate]

I am trying to display my XQuery code in a latex document as follows: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{listings} \title{code} \date{January 2016} \begin{document} \...