UPDATE: The final palette has a new home here! Please test and provide feedback (usability, suggestions, bugs)
A note to the readers and voters: This is intended for community use, so please test the palettes in practice! I encourage all answerers to "steal" from each others, and come up with a solution that is the most pleasant / practical to use.
Sjoerd suggested that when we want to post input lines that alternate with output lines, instead of including the In/Out labels, we could simply comment out the output.
Read his suggestion here:
I have seen several people use this style in the past few days. The only problem with it that it requires a lot of manual editing (too much work for my taste).
How can we automate this process?
The challenge is:
Create a palette button that will copy the selection in the format suggested by Sjoerd. Two-dimensional expressions (i.e. things like $\int x^2 \; dx$) should be converted to plain text or input form. The notebook contents must not be modified/destroyed.
An example (directly copied from Sjoerd's post):
In[108]:= D[Cos[x] Exp[x], x]
Out[108]= E^x Cos[x] - E^x Sin[x]
should be copied as
D[Cos[x] Exp[x], x]
(*
===> E^x Cos[x] - E^x Sin[x]
*)
Let us ignore cells that are neither input nor output for now (text, headings, etc.)
Can we create a tool that is good enough to be of practical use to the community?
\[Pi]
asPi
and\[Infinity]
asInfinity
etc... $\endgroup$ – Simon Jan 22 '12 at 23:11===>
standard for denoting output becoming? I used it for the first time in an answer recently, and somebody quite quickly edited my answer to remove it, and simply leave the output in comments. $\endgroup$ – John Fultz Jun 10 '12 at 8:48==>
, and some just use a quotation block (again, inconvenient to copy, and personally I don't like it if it's not in a fixed width font). Don't be discouraged from using that notation if you like it. $\endgroup$ – Szabolcs Jun 11 '12 at 15:53