Related :
Plot[\[Alpha], {\[Alpha], 0, 8}]
cellExpression
(*
Cell[BoxData[RowBox[{Plot,[,RowBox[{\[Alpha],,,RowBox[{{,RowBox[{\[Alpha],,,0,,,8}],}}]}],
]}]],Input,CellChangeTimes->{3.58068*10^9,{3.58068*10^9,3.58068*10^9}}]
*)
CellExpression2InputText[cellExpression_] := First[FrontEndExecute[
FrontEnd`ExportPacket[cellExpression, "InputText"]]]
CellExpression2InputText[cellExpression]
(*
Plot[\[Alpha], {\[Alpha], 0, 8}]
*)
CellExpression2InputText[cellExpression] // CopyToClipboard
Paste[]
Plot[\[Alpha], {\[Alpha], 0, 8}]
when copy the result above to SE, the [Alpha] was not shown in Unicode Form. And I failed in my usage involved with CellExpression2InputText
Mr.Wizard's method, this is good to copy directly from input cell.
SetAttributes[copyUnicode, HoldFirst]
copyUnicode[expr_, form_: InputForm] :=
Run["clip <", Export["$Clipboard.temp", ToString[Unevaluated @ expr, form],
"Text", CharacterEncoding -> "Unicode"]];
case 1
CellExpression2InputText[cellExpression] // copyUnicode
Paste[]
PasteResult(not good)
CellExpression2InputText[cellExpression]
case 2
ToExpression[CellExpression2InputText[cellExpression], InputForm, HoldForm] // copyUnicode
Paste[]
still not good
question
So question is clear:
How to convert CellExpression to string/clipboard with greek letters in Unicode Form when copy to SE without laborious work by hand.
\[Alpha] ==> to α
Like code blocks, code spans will be displayed in a monospaced font. Markdown and HTML will not work within them. Note that, [unlike] code blocks, code spans require you to manually escape any HTML within!I donot know what is the unlike mean. Because I found that they both keep the html tags. – HyperGroups Jun 20 '13 at 07:52