DiffIgnore
Diffおよび関連関数のオプションで,差分の計算時に無視する要素を指定する.
詳細
- DiffIgnore{elem1,elem2,…}は,差分の計算時に指定された要素を無視する.
- ノートブックあるいはセルを比較する際にサポートされる要素には以下がある.
-
"BoxOptions" すべてのボックスオプションを無視する "CellOptions" すべてのセルオプションを無視する "CellStyles" すべてのセルスタイルを無視する "InlineCellOptions" すべてのインラインセルオプションを無視する "InlineCellStyles" すべてのインラインセルスタイルを無視する "NotebookOptions" すべてのノートブックオプションを無視する elem{item1,item2,…} 指定された要素の特定のオプション名またはスタイルを無視する
例題
すべて開く すべて閉じる例 (3)
セルを比較する際,Diffはコンテンツの変更に加えてスタイルの変更も見付ける:
Diff[Cell["2+2", "Input"], Cell["3*5", "InputOnly", FontSize -> 14], Appearance -> "Details"]DiffIgnoreを使ってスタイルとオプションのすべての変更を無視する:
Diff[Cell["2+2", "Input"], Cell["3*5", "InputOnly", FontSize -> 14], Appearance -> "Details", DiffIgnore -> {"CellStyles", "CellOptions"}]DiffIgnoreを使って特定のセルオプションを無視する:
Diff[
Cell["Hello world", "Text", FontSize -> 16],
Cell["Hello world", "Text", FontColor -> Blue], Appearance -> "Details", DiffIgnore -> "CellOptions" -> {FontColor}]Diffは,ノートブックを比較する際はノートブックのオプションの変更も含める:
Diff[File[...], File[...]]["NotebookOptionDetails"]DiffIgnoreを使って特定のノートブックオプションを無視する:
Diff[File[...], File[...], DiffIgnore -> {"NotebookOptions" -> {WindowSize, WindowMargins}}]["NotebookOptionDetails"]考えられる問題 (1)
Table[uuid[i] = ExpressionUUID -> CreateUUID[], {i, 3}];
nb1 = Notebook[{
Cell["title", "Title", uuid@1],
Cell["subtitle", "Subtitle", uuid@2]}];
nb2 = Notebook[{
Cell["title", "Title", uuid@1],
Cell["abstact", "Abstract", uuid@3],
Cell["subtitle edited", "Subtitle", uuid@2]}];セルオプションExpressionUUIDを無視すると,結果のアラインメントが変わるかもしれない:
Diff[nb1, nb2]["SideBySide"]Diff[nb1, nb2, DiffIgnore -> {"CellOptions" -> ExpressionUUID}]["SideBySide"]テキスト
Wolfram Research (2024), DiffIgnore, Wolfram言語関数, https://reference.wolfram.com/language/ref/DiffIgnore.html.
CMS
Wolfram Language. 2024. "DiffIgnore." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DiffIgnore.html.
APA
Wolfram Language. (2024). DiffIgnore. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DiffIgnore.html
BibTeX
@misc{reference.wolfram_2026_diffignore, author="Wolfram Research", title="{DiffIgnore}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/DiffIgnore.html}", note=[Accessed: 10-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_diffignore, organization={Wolfram Research}, title={DiffIgnore}, year={2024}, url={https://reference.wolfram.com/language/ref/DiffIgnore.html}, note=[Accessed: 10-September-2026]}