This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

CopyToClipboard

CopyToClipboard[expr]
replaces the contents of the clipboard with expr.
  • The expression expr is evaluated and typeset before being copied to the clipboard. To copy a textual form, specify a string or InputForm[expr].
  • The expression expr can be any expression, including those that represent notebooks or cells.
  • When pasted in between cells, the results of CopyToClipboard will be at the highest fidelity. Style or formatting information may be lost when pasting into an existing cell or when pasting into an application other than Mathematica.
Copy a simple expression to the clipboard:
Use Defer to copy an unevaluated form of the expression:
Copy the StandardForm representation of an expression:
Copy the InputForm representation of an expression:
Copy a simple expression to the clipboard:
In[1]:=
Click for copyable input
Out[1]=
 
Use Defer to copy an unevaluated form of the expression:
In[1]:=
Click for copyable input
Out[1]=
 
Copy the StandardForm representation of an expression:
In[1]:=
Click for copyable input
Out[1]=
 
Copy the InputForm representation of an expression:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Copying a string copies the contents of the string:
Copy a graphic:
A series of discrete cells can be copied by using DocumentNotebook:
Copied cells preserve any specified style information:
Create a button to copy the contents of an interface:
Pick a point and copy its coordinates:
Copying a cell expression preserves that expression exactly on the clipboard:
Evaluation of expressions can have unexpected effects such as reordering the copied result:
All such effects can be prevented using Defer:
When CopyToClipboard receives a string with embedded typesetting, it is copied using :
New in 8