1
$\begingroup$

By Linux style copy-paste I mean highlight by dragging left mouse and paste by clicking middle mouse. Doing so to copy from Mathematica 11.0 to an xterm or editor works, but after 65 characters, "\\n" is inserted. This happens if the copied content comes from an Input, Output, or Print cell. If the content comes from a Text cell then there is no problem.

If copying to an xterm (for example a long path name from the output of FindFile), then one can use this longer procedure: highlight, right click, select "Copy as" -> "Plain Text", right click in the xterm (works for KDE Konsole), and then select "Paste". However, it is too long for my liking and it doesn't work for emacs.

By the way, the reason for the "\\n" is because in Mathematica one can type,

"abc\
def"

to get the output string "abcdef", provided the Enter immediately follows the backslash (i.e., no spaces after it).

I'm guessing that somewhere there is a parameter that sets the 65 character limit. Does anyone know where it is and how best to change it?

$\endgroup$

marked as duplicate by Mr.Wizard Sep 23 '16 at 7:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1
$\begingroup$

I didn't search enough... The answer for this question works: How to copy code out of notebook to an external text editor without extra line feeds being added? The "\\n" will be inserted after the number of characters specified by "PageWidth".

$\endgroup$
  • $\begingroup$ Thanks for finding this and self-answering. +1. However based on this I shall close this question as a duplicate; it will remain as an entry point for searches that directs to the older question. $\endgroup$ – Mr.Wizard Sep 23 '16 at 7:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.