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

Documentation / Mathematica / Add-ons & Links / AuthorTools / Function Interface /

Finding Differences

This section assumes that you have already loaded the AuthorTools package and set the variables nb1 and nb2 to represent the notebooks you wish to process. (See Using Functions for more information.)

This generates a notebook that lists the differences between the two notebooks, nb1 and nb2


NotebookDiff will also find the differences between two projects, directories, or lists of files. This generates a notebook that summarizes the differences in the two sets of notebooks.

NotebookDiff[project1, project2]

By default, NotebookDiff finds all possible differences between the notebooks, including differences in cell styles or options. However, you can narrow the scope of differences reported by NotebookDiff by specifying options. For example, this excludes cells in the Input and Output style from the diffing operation.

NotebookDiff[nb1,nb2, ExcludeCellsOfStylesRule {"Input","Output"}]

There are several other options to NotebookDiff, for example, to ignore cells that have the same content but differ only in their cell style or only in their options.

To view the differences within two different cells, use CellDiff. This highlights the differences in content by enclosing them in colored brackets of the form: ( LeftAngleBracket and RightAngleBracket). Style and option differences are also listed.

CellDiff[cell1, cell2]

If the notebooks you are comparing are style sheets, you can either use NotebookDiff or a more specialized version called StyleSheetDiff.


NotebookDiff and StyleSheetDiff are both implemented in terms of a lower-level function called DiffReport. This compares two generic lists, creating a report of all the insertions, deletions, and updates between the two lists.