TextClipboardType
Details
- TextClipboardType is typically used in stylesheets to customize the default clipboard behavior for different cell styles.
- Choose Edit ▶ Copy As instead of TextClipboardType to change the clipboard type for a single copy operation.
- The following settings can be used:
-
"PlainText" preserve the cell as plain text; equivalent to Edit ▶ Copy As ▶ Plain Text "InputText" preserve the Wolfram System's ability to reevaluate the cell; equivalent to Edit ▶ Copy As ▶ Input Text "Package" return exactly what you would get if you saved the cell as a package - By default, the value of TextClipboardType is "InputText" for input and output cells, "PlainText" for textual, print, and message cells, and "Package" for code cells.
- Both "InputText" and "Package" preserve evaluation semantics. "InputText" will adjust white space and line breaks to make the result more readable, while "Package" preserves the whitespace exactly as it was typed into the cell.
- "PlainText" creates a textual form that closely resembles the visual appearance, even if that appearance would not evaluate in Wolfram Language.
Examples
open allclose allBasic Examples (3)
Select the printed input cell below, choose Edit ▶ Copy, and paste into a text editor:
2+2 a
b c
Select the printed input cell below, choose Edit ▶ Copy, and paste into a text editor:
{
{2 + 2, a},
{b, c}
}
Select the printed input cell below, choose Edit ▶ Copy, and paste into a text editor:
{
{2+2, a},
{b, c}
}
Properties & Relations (4)
When copying invisible boxes, "PlainText" will omit them:
abc
Other forms will preserve the box structure if necessary to preserve evaluation semantics:
\!\(
TagBox["abc",
"tag"]\)
"PlainText" will not include the quotes in a copied string if they did not display in the cell:
2+string
InterpretationBox (1)
InterpretationBox copies as its appearance for "PlainText":
fish
Other values will copy the interpretation:
"fowl"
TemplateBox (1)
TemplateBox copies the boxes in DisplayFunction for "PlainText":
2 millions
Other values will copy the InterpretationFunction:
2*10^6
Possible Issues (1)
It is possible to override rules for some very common typesetting structures:
TextClipboardType will not consult kernel formatting rules to resolve these common cases:
super^5
A better approach is to create a formatting rule that uses a TagBox or TemplateBox:
\!\(
TagBox[
SuperscriptBox["super", "5"],
$CellContext`super]\)
Text
Wolfram Research (2008), TextClipboardType, Wolfram Language function, https://reference.wolfram.com/language/ref/TextClipboardType.html.
CMS
Wolfram Language. 2008. "TextClipboardType." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TextClipboardType.html.
APA
Wolfram Language. (2008). TextClipboardType. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TextClipboardType.html