TextClipboardType
詳細
- TextClipboardTypeは一般にスタイルシートでのさまざまなセルスタイルのデフォルトのクリップボード動作のカスタマイズに使われる.
- TextClipboardTypeの代りに「編集」▶「形式を選択してコピー」を選ぶと1つのコピー操作のクリップボードタイプが変更できる.
- 使用可能な設定値
-
"PlainText" セルをテキストとして保存.「編集」▶「形式を選択してコピー」▶「テキスト」に等しい "InputText" Wolframシステムのセル再評価機能を保存,「編集」▶「形式を選択してコピー」▶ 「入力テキスト」に等しい "Package" セルをパッケージとして保存した場合と全く同じ結果を返す - デフォルトのTextClipboardTypeの値は,入出力セルについては"InputText",テキスト,印刷,メッセージの各セルについては"PlainText",コードセルについては"Package"である.
- "InputText"および"Package"は,どちらも評価動作を保存する."InputText"は余白および改行を調整し,結果をより読みやすくする."Package"は余白をセルに打ち込まれたのと全く同じに保つ.
- "PlainText"は,たとえその外観がWolfram言語で評価できなくても,視覚表現とほぼ等しいテキスト形式を作る.
例題
すべて開く すべて閉じる例 (3)
以下に表示されたセルを選択し,「編集」▶「コピー」を選んでテキストエディタにペーストする:
Cell[BoxData[GridBox[{{RowBox[{"2", "+", "2"}], "a"}, {"b", "c"}}]], "Output", TextClipboardType -> "PlainText"]//CellPrint2+2 a
b c
以下に表示されたセルを選択し,「編集」▶「コピー」を選んでテキストエディタにペーストする:
Cell[BoxData[GridBox[{{RowBox[{"2", "+", "2"}], "a"}, {"b", "c"}}]], "Output", TextClipboardType -> "InputText"]//CellPrint{
{2 + 2, a},
{b, c}
}
以下に表示されたセルを選択し,「編集」▶「コピー」を選んでテキストエディタにペーストする:
Cell[BoxData[GridBox[{{RowBox[{"2", "+", "2"}], "a"}, {"b", "c"}}]], "Output", TextClipboardType -> "Package"]//CellPrint{
{2+2, a},
{b, c}
}
特性と関係 (4)
不可視ボックスをコピーすると,"PlainText"はそれを除外する:
Cell[BoxData[TagBox["abc", "tag"]], "Output", TextClipboardType -> "PlainText"]//CellPrintabc
他の形式は,評価動作のために保存することが必要な場合は,ボックス構造が保存される:
Cell[BoxData[TagBox["abc", "tag"]], "Output", TextClipboardType -> "InputText"]//CellPrint\!\(
TagBox["abc",
"tag"]\)
"PlainText"は,コピーされた文字列のクォートは,それがセルに表示されていない場合は含まない:
Cell[BoxData[RowBox[{"2", "+", "\"string\""}]], "Output", TextClipboardType -> "PlainText"]//CellPrint2+string
InterpretationBox (1)
InterpretationBoxは"PlainText"の外観でコピーされる:
Cell[BoxData[InterpretationBox["fish", "fowl"]], "Output", TextClipboardType -> "PlainText"]//CellPrintfish
Cell[BoxData[InterpretationBox["fish", "fowl"]], "Output", TextClipboardType -> "InputText"]//CellPrint"fowl"
TemplateBox (1)
TemplateBoxは,DisplayFunction中のボックスを"PlainText"でコピーする:
Cell[BoxData[TemplateBox[{"2"}, "template", DisplayFunction :> (RowBox[{#, " millions"}]&), InterpretationFunction :> (RowBox[{#, "*", "10^6"}]&)]], "Output", TextClipboardType -> "PlainText"]//CellPrint2 millions
他の値はInterpretationFunctionをコピーする:
Cell[BoxData[TemplateBox[{"2"}, "template", DisplayFunction :> (RowBox[{#, "millions"}]&), InterpretationFunction :> (RowBox[{#, "*", "10^6"}]&)]], "Output", TextClipboardType -> "InputText"]//CellPrint2*10^6
考えられる問題 (1)
非常に一般的なタイプセット構造の規則を無効にするすることができる:
MakeExpression[SuperscriptBox["super", val_], StandardForm] := MakeExpression[RowBox[{"super", "[", val, "]"}], StandardForm];
super^5TextClipboardTypeは,次のような一般的な例を解決するためにカーネルのフォーマット規則を参考にしはしない:
Cell[BoxData[SuperscriptBox["super", "5"]], "Output", TextClipboardType -> "InputText"]//CellPrintsuper^5
TagBoxあるいはTemplateBoxを使うフォーマッティング規則を作った方がよいだろう:
MakeExpression[TagBox[SuperscriptBox[_, val_], super], StandardForm] := MakeExpression[RowBox[{"super", "[", val, "]"}], StandardForm];
CellPrint[Cell[BoxData[TagBox[SuperscriptBox["super", "5"], super]], "Output", TextClipboardType -> "InputText"]]\!\(
TagBox[
SuperscriptBox["super", "5"],
$CellContext`super]\)
テキスト
Wolfram Research (2008), TextClipboardType, Wolfram言語関数, 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
BibTeX
@misc{reference.wolfram_2026_textclipboardtype, author="Wolfram Research", title="{TextClipboardType}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/TextClipboardType.html}", note=[Accessed: 06-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_textclipboardtype, organization={Wolfram Research}, title={TextClipboardType}, year={2008}, url={https://reference.wolfram.com/language/ref/TextClipboardType.html}, note=[Accessed: 06-November-2026]}