Forrest logo
back to the latexdiff tool

latexdiff:tldr:0bf7e

latexdiff: Determine changes between different versions of a LaTeX file, and display minor changes in equations with both added and deleted graphics.
$ latexdiff --math-markup=fine --graphics-markup=both ${old-tex} ${new-tex} > ${diff-tex}
try on your machine

The command you provided is a command-line instruction for using the "latexdiff" tool to compare two LaTeX files and generate a new LaTeX file that highlights the differences between them. Let's break it down:

  • "latexdiff": This is the name of the command-line tool that performs the comparison of LaTeX files and generates a diff file.
  • "--math-markup=fine": This option specifies the level of markup for mathematical formulas. In this case, "fine" indicates that the differences in math content will be shown in greater detail.
  • "--graphics-markup=both": This option specifies the handling of graphics and figures. "both" means that changes in both graphics content and captions will be marked.
  • "${old-tex}": This is a placeholder for the path or filename of the original LaTeX file to be compared.
  • "${new-tex}": This is a placeholder for the path or filename of the modified LaTeX file to be compared.
  • "${diff-tex}": This is a placeholder for the path or filename of the diff file that will be generated.

Putting it all together, when executing this command, the "latexdiff" tool will compare the original LaTeX file (${old-tex}) with the modified LaTeX file (${new-tex}). The differences between them will be marked according to the specified markup options for mathematics and graphics. Finally, the resulting highlighted differences will be saved in the diff file (${diff-tex}).

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the latexdiff tool