Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Make an expression that is copied to the clipboard when clicked
ResourceFunction["ClickToCopy"][expr] returns a version of expr that can be copied to the clipboard by clicking it. | |
ResourceFunction["ClickToCopy"][disp,copy] displays as disp, but copies to the clipboard as copy when clicked. | |
ResourceFunction["ClickToCopy"][disp,copy,int] displays as disp, copies to the clipboard as copy when clicked, and is interpreted as int when evaluated. |
Create a click-to-copy expression:
| In[1]:= |
|
| Out[1]= |
|
Click the preceding expression, then paste the result:
| In[2]:= |
|
| Out[2]= |
|
Mousing over the output of ClickToCopy displays a tooltip:
Clicking changes the tooltip display:
Display an expression in StandardForm, but copy as InputForm when clicked:
| In[3]:= |
|
| Out[3]= |
|
Click the preceding expression, then paste the result:
| In[4]:= |
|
Display an expression in StandardForm, copy as InputForm when clicked, but interpret numerically if the entire output is copied:
| In[5]:= |
|
| Out[5]= |
|
Copy the previous output, paste it in a new cell and evaluate:
| In[6]:= |
|
| Out[6]= |
|
Create a list of click-to-copy expressions:
| In[7]:= |
|
| Out[7]= |
|
Use Defer to prevent evaluation:
| In[8]:= |
|
| Out[8]= |
|
Click the preceding expression, then paste the result:
| In[9]:= |
|
| Out[9]= |
|
Copying a cell expression preserves that expression exactly on the clipboard:
| In[10]:= |
|
| Out[10]= |
|
Click the preceding expression, then paste the result:
| In[11]:= |
|
| Out[11]= |
|
Shorten the display of a large expression, but copy the entire thing when clicked:
| In[12]:= |
|
| Out[11]= |
|
Click the preceding expression, then paste the result:
| In[13]:= |
|
| Out[13]= |
|
Use Unevaluated to delay evaluation until clicked:
| In[14]:= |
|
| Out[14]= |
|
Click the preceding expression, then paste the result:
| In[15]:= |
|
| Out[15]= |
|
Click it again and then paste it to get a different color:
| In[16]:= |
|
| Out[16]= |
|
Compare to using Defer:
| In[17]:= |
|
| Out[17]= |
|
Click the preceding expression, then paste the result:
| In[18]:= |
|
| Out[18]= |
|
ClickToCopy is just a formatting wrapper:
| In[19]:= |
|
| Out[19]= |
|
| In[20]:= |
|
| Out[20]= |
|
Create a click-to-copy input cell:
| In[21]:= |
|
The cell can be clicked to copy the input as well as be evaluated normally:
Make all the input cells in a notebook click-to-copy:
| In[22]:= |
|
| In[23]:= |
|
| Out[23]= |
|
The notebook can be evaluated normally:
| In[24]:= |
|
| Out[24]= |
|
| In[25]:= |
|
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License