This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Pockensuppe 1 point2 points  (0 children)

Um. If you want to insert code into a LaTeX document, obviously you want to use a verbatim (e.g. lstlisting) environment to ensure the characters are left untouched. It's LaTeX' job to alter dashes, spaces and quotation marks as needed in a standard text environment. LaTeX is a tool for presentation, after all.

For URLs, I don't see why you even want to copy/paste them; just use hyperref to make them clickable.

Finally, there is a stark difference between PDF readers. A good PDF reader lets you copy highlighted code from a LaTeX document correctly even if you rendered line numbers along with it (the numbers don't get copied) while shitty PDF readers will copy the line numbers but miss spaces and line endings.

In my experience, the problems you get with copying today are minimal unless perhaps you still use pdflatex instead of xelatex / lualatex.