9

Following on from this question: Is it possible to convert an expression to InputForm or StandardForm without losing the comments?

For example,

f[blah_] := Cos[blah] (* this is a comment *)
f[blah2_] := Cos[blah2] (* this is also a comment *)

selecting the cell and pressing Shift+Ctrl+N gives,

f[blah_] := Cos[blah] 
f[blah2_] := Cos[blah2]
geordie
  • 3,693
  • 1
  • 26
  • 33
  • 3
    Not that I am aware of, but there may be an undocumented function that does this. You never know. – Mr.Wizard Feb 25 '13 at 12:47
  • How would you format, for example, (Sum(* boo *))[x, x] in standard form? – Rojo Feb 25 '13 at 20:56
  • 1
    @Rojo I would like to turn it into a ToolTip :) – Silvia Feb 26 '13 at 03:18
  • 1
    @Silvia then we want to convert it into SilviaForm :). Tooltip of the big sigma? I'm just thinking that the specifications are not so automatic – Rojo Feb 26 '13 at 12:31
  • @Rojo TemplateBox[{"x","boo",ToBoxes[f[x]]},"commentedSum",DisplayFunction:>(RowBox[{TooltipBox[UnderscriptBox["\[Sum]",#1],#2],#3}]&)]//RawBoxes :) btw SilviaForm is a great name! I'll consider using it somewhere ;) – Silvia Feb 26 '13 at 18:57

1 Answers1

2

If you highlight the code you wish to convert (one line at a time) and right click, then Convert To: this might be what your looking for.

Bob Brooks
  • 466
  • 2
  • 13