Hot answers tagged copy-as
10
Since a native method is not forthcoming, I shall post my file based circumvention, for Windows.
You will need to have this utility in the command path (it apparently is stock with Windows 7).
copyUnicode[expr_] := Run["clip <",
Export["$Clipboard.temp", ToString[expr, InputForm],
"Text", CharacterEncoding -> "Unicode"] ];
Usage:
expr ...
6
To circumvent Mathematica's internal representation, I decided to use the operating system. Of course, this means it's only going to work on Mac OS X because it uses Cocoa bindings in the built-in Python interpreter:
copyAsUnicode[t_] := Module[{
out = FileNameJoin[{$TemporaryDirectory,
"MathematicaOutput" <> StringJoin[Map[ToString, ...
2
I'm not understanding, or I can't reproduce the behaviour of the pasting of the first part, please post a more concrete example. As to the 0.3333 issue, you could set the NumberMarks option of the input cells to False. Also, if you really meant that you wanted it copied as 0.3333 when your output had been 0.333333 you should also change PrintPrecision to 4
...
1
Here's a version that doesn't require a temporary file.
Linux (needs xclip)
SetAttributes[copyUnicode, HoldAll];
copyUnicode[expr_] := With[{
stream = OpenWrite["!xclip -in -selection clipboard", CharacterEncoding -> "UTF-8"]
},
WriteString[stream, ToString[Unevaluated@expr, InputForm]];
Close@stream;
];
Example: executing the cell
...
Only top voted, non community-wiki answers of a minimum length are eligible

