latexdiff tutorial

Example:

For a simple example, suppose version 1 of our LaTeX document is the following: Screenshot

We notice a few errors, so we fix them in version 2 below: Screenshot

If we want to easily see the differences between the two versions, latexdiff will produce the following: Screenshot

Instructions:

  1. Install latexdiff

for example: sudo dnf install -y texlive-latexdiff (Fedora)

  1. Clone this repository

  2. Run the following command:

    latexdiff version1.tex version2.tex > diff2.tex

  3. Compile the resulting diff2.tex

    for example: pdflatex diff2.tex

  4. Open the output pdf file with your favorite pdf viewer

    for example: evince diff2.pdf

References

1. Using overleaf and latexdiff

2. git and latexdiff

3. How to calculate circumference of a circle, if you forgot how to

4. To ignore certain environments in case of errors

5. Main latexdiff CTAN's site