2011-07-01 The latexdiff script (en)

It is quite often the case that when working on some document, one has two versions of the same file – an “older” one and a “newer” one. Sometimes – especially with longer documents – it is very useful to be able to track down where the differences between them are exactly located. The well-known (especially in the un*x world, that is) diff utility is not of much use, since it compares files line by line and not word by word, which is better for (La)TeX files – after all, a single newline and a space are the same for LaTeX. That is why the latexdiff script is such a useful tool. Essentially, it does exactly what is says on the tin: it takes two LaTeX files, compares them (taking into account the space/newline issue as well as LaTeX commands and such) and yields a third LaTeX file, which (after compilation) gives a nice visual representation of the changes (red strikeover/blue underline for deletions/additions, or change bars in the margin, or several other options).

How to get latexdiff? Well, you probably have it: it’s in texlive, it’s in MikTeX, so just use your package manager to install it if it’s not already there. I won’t cover the usage – just look at the manual, which seems lengthy (24 pages), but you won’t need to read it all to use latexdiff.

CategoryEnglish, CategoryBlog, CategoryTeX, KategoriaTeX, KategoriaLaTeX, KategoriaLaTeXPorady