So, an input cell after evaluation gives an

In[X] := str1 = ...
Out[X]:= ....

If I right click on the right edge of the Out[X]'s cell, and select Copy As > Plain text in the context menu, and then open a new text file in Emacs and paste it in. Then I use str2 = Import[file, "String"]. What is the difference between str1 and str2? How do I get str2 without using an external file?

  • $\begingroup$ You could try using ExportString[] along with InputForm[]. $\endgroup$ Commented Apr 1, 2016 at 2:44
  • $\begingroup$ Do you mean InputForm[ExportString[str1]] === str2 is True? If not, what do you mean exactly? $\endgroup$
    – user13253
    Commented Apr 1, 2016 at 3:51
  • $\begingroup$ I was in the suspicion that Copy As > Plain text calls some FrontEnd function and is not always same as using some combination of kernel functions. $\endgroup$
    – user13253
    Commented Apr 1, 2016 at 3:52
  • 4
    $\begingroup$ Is that what you are after? mathematica.stackexchange.com/q/1319/5478 $\endgroup$
    – Kuba
    Commented Apr 1, 2016 at 6:20


Browse other questions tagged or ask your own question.