latexdiff-fast (1) Linux Manual Page
NAME
latexdiff – determine and markup differences between two latex files
SYNOPSIS
latexdiff [ OPTIONS ] old.tex new.tex > diff.tex
DESCRIPTION
Briefly, latexdiff is a utility program to aid in the management of revisions of latex documents. It compares two valid latex files, here called "old.tex" and "new.tex", finds significant differences between them (i.e., ignoring the number of white spaces and position of line breaks), and adds special commands to highlight the differences. Where visual highlighting is not possible, e.g. for changes in the formatting, the differences are nevertheless marked up in the source. Note that old.tex and new.tex need to be real files (not pipes or similar) as they are opened twice (unless "--encoding" option is used)
The program treats the preamble differently from the main document. Differences between the preambles are found using line-based differencing (similarly to the Unix diff command, but ignoring white spaces). A comment, ""%DIF >"" is appended to each added line, i.e. a line present in "new.tex" but not in "old.tex". Discarded lines
are deactivated by prepending ""%DIF <"". Changed blocks are preceded
- 1.
- If both "old.tex" and "new.tex" are valid LaTeX, then the resulting "diff.tex" should also be valid LateX. (NB If a few plain TeX commands are used within "old.tex" or "new.tex" then "diff.tex" is not guaranteed to work but usually will).
- 2.
- Significant differences are determined on the level of individual words. All significant differences, including differences between comments should be clearly marked in the resulting source code "diff.tex".
- 3.
- If a changed passage contains text or text-producing commands, then running "diff.tex" through LateX should produce output where added and discarded passages are highlighted.
- 4.
- Where there are insignificant differences, e.g. in the positioning of line breaks, "diff.tex" should follow the formatting of "new.tex"
For differencing the same algorithm as diff is used but words instead of lines are compared. An attempt is made to recognize blocks which are completely changed such that they can be marked up as a unit. Comments are differenced line by line but the number of spaces within comments is ignored. Commands including all their arguments are generally compared as one unit, i.e., no mark-up is inserted into the arguments of commands. However, for a selected number of commands (for example, "
