Information on difference file available on N. C. Phillips' web pages

This page describes the interpretation of the difference files provided through the home pages for my courses and my research. These files show changes between versions in TeX files, color coded in pdf format.

TeX difference files

A "difference file" (often called "Diff.pdf" or some longer name ending with "Diff.pdf") shows the differences between the two versions, with new text wavy underlined in blue and old text crossed out in red.

A "reverse difference file" (often called "RevDiff.pdf", "ReverseDiff.pdf" or some longer name ending with one of these) is the same except for the color scheme: new text is wavy underlined in red and old text crossed out in blue.

I use both versions, because I find blue to be not very conspicuous, making it easy to miss added text.

The files are generated from TeX files by the normal TeX program. The TeX files, if posted, will have analogous names.

Warning: Changes in the TeX source file which make no difference to the output (such as changing "$x-y$" to "$x - y$": adding spaces to make the TeX code more readable; replacing a macro by its definition or vice versa) are often shown as changes in the difference files.

Warning: Changes in some environments (including "\tt") are not detected at all. You will see the new version with no indication that there was any change.

Warning: One small change somewhere in a formula sometimes results in a large amount of material shown as being changed, sometimes the entire formula.

Warning: Displayed equations with changes often go off the right edge of the page.

Warning: Difference files are useful only for small changes. In a part of the file in which there are extensive changes, the difference file will be unreadable. In particular, simply moving a lemma and its proof from one part of a paper to another can lead to hard to interpret difference files.

Warning: If there are differences inside commutative diagrams, picture environments, some other environments (such as "smallmatrix"), parts of the file generated by packages, or sometimes even just complicated displayed equations, the program may generate files with TeX errors, often sufficiently serious that TeX can't process the file. Sometimes this is fixed by deleting the relevant parts of the TeX version of the difference file. Other times, the TeX version of the difference file may still run but complain about errors.

The TeX versions of the difference files are made with the perl program "latexdiff-so", gotten 24 March 2015 from a link on (The program is run by typing a suitable command into a UNIX or Linux terminal window.) To make the reverse difference files, I simply made a new copy of the program and switched red and blue. (This is permitted under the license under which I received the program.) The pdf files are made from the TeX files the same way as for any other TeX file.

Text difference files

A text difference file (often called "dfile.txt" or some longer name starting with "dfile" and ending with ".txt") is a line by line comparison of plain text files (often TeX source files). Lines starting "< " are from the old version; lines starting "> " are from the new version. If M and N are numbers or ranges of line numbers, "McN" means the lines in range M in the old file have been replaced by the lines in range N in the new file, "MdN" means the lines in range M in the old file have been deleted (and the place where they would have been is after line N in the new file), and "MaN" means the lines in range N in the new file did not exist in the old file, and have been added after what was line M in the old file. Ranges are numbers separated by commas, such as 36,43.

Warning: A single character change means the whole line is different; there is no finer information provided. Thus, if lines in the input files are very long, it will be hard to find small changes.

Warning: Changes in invisible characters cause the program to list changes in lines which look identical. As a dramatic example: if the second file is different only in that a space character has been added to the end of every line, the program will not recognize any similarities in the two files at all.

Warning: Order is preserved. Moving a lemma and its proof from one part of a paper to another will lead to a difference file saying it has been deleted in one place and added in another. If there are also internal changes in the moved text, the difference file won't help you find them.

Warning: If there are many lines with changes, or many small changes in the order of lines, the program may get confused and try to compare incomparable parts of the files.

Warning: Microsoft line breaks aren't real line breaks. The program thinks a file with Microsoft line breaks consists of just one very long line, and its output is useless.

This page maintained by N. Christopher Phillips, email.

Last significant change 18 February 2019.