Comprehensive TeX Archive Network

Direc­tory tex-archive/support/latexdiff


latexdiff is a Perl script, which compares two latex files and marks
up significant differences between them (i.e. a diff for latex files).
  Various options are available for visual markup using standard latex 
packages such as "color.sty". Changes not directly affecting visible 
text, for example in formatting commands, are still marked in 
the latex source. Note that only files conforming to latex syntax will 
be processed correctly, not generic TeX files. Some further 
minor restrictions apply, see documentation.
A rudimentary revision facilility is provided by another Perl script,
latexrevise, which accepts or rejects all changes.  Manual
editing of the difference file can be used to override this default
behaviour and accept or reject selected changes only.  

The author is F Tilmann. 

Project webpage:   https://github.com/ftilmann/latexdiff/
CTAN page:         http://www.ctan.org/pkg/latexdiff


Perl 5.8 or higher must be installed.
  The latexdiff script makes use of the Perl package Algorithm::Diff (available 
from www.cpan.org, current version 1.19). You can either install this package, or
use the standalone version of latexdiff, latexdiff-so, which has version 1.15 of 
this package inlined and does not require external installation of
the package. Because latexdiff uses internal functions of Algorithm:Diff whose 
calling format or availability can change without notice, the preferred method is
now to use the standalone version.

As an alternative, latexdiff-fast has a modified version of Algorithm::Diff inlined,
which internally uses the UNIX diff command.  This version is much faster but is dependent
on an external "diff" command.  Subtle differences in the algorithm of Algorithm::Diff and 
UNIX-diff mean that the resulting set of differences will generally not be the same as
for the standard latexdiff.  In most practical cases, these differences are minor, though.


The basic installation procedure is almost trivial:

1. Copy latexdiff, latexrevise and latexdiff-vc into a directory which
   is in the search path and make them executable.  If the Algorithm::Diff
   package is not installed, use latexdiff-so instead of latexdiff. 

2. Copy latexdiff.1 and latexrevise.1 into the correct man directory

3. Optionally create soft links latexdiff-cvs latexdiff-rcs, latexdiff-git
   latexdiff-svn and latexdiff-hg for latexdiff-vc.

The attached trivial Makefile contains example commands to carry out above 
steps as root for a typical UNIX installation. Type 

  make install          (for the stand alone version)
  make install-ext      (for the version using the external Algorithm::Diff)
  make install-fast     (for the version using the UNIX 'diff' function for fast differencing)

to get it rolling.  You can type

  make test
  make test-ext
  make test-fast

to test the respective versions on a brief example before installation. It will often be
as easy to carry out these steps manually instead of using the Makefile.


Usage instructions are in the manual latexdiff-man.pdf as well as the 
man pages.


Check out the comment lines at the beginning of the perl scripts (latexdiff, latexdiff-vc, latexrevise)


The directory contrib contains code written by others relating to latexdiff.  
Currently this directory contains:

latexdiff-wrap (Author: V. Kuhlmann) An alternative wrapper script which can be used
  instead of latexdiff-vc.  Its main use is as a template for customised wrapper scripts.

latexdiff.spec (Author: T. Doerges) spec file for RPM generation

latexchanges (Author: Jan-Ake Larsson) Wrapper script for applying latexdiff with numbered documen version 
(see contrib/README.latexchanges for a more detailed description)

Contributions by the following authors were incorporated into the latexdiff code, or inspired me to 
extend latexdiff in a similar way: J. Paisley, N. Becker, K. Huebner


LATEXDIFFCITE (Author: Christer van der Meeren)  is a wrapper around latexdiff to make citations diff properly. It works by expanding \cite type commands using the bbl or bib file, such that citations are treated just like normal text rather than as atomic in the plain latexdiff.

GIT-LATEXDIFF (lead author: Matthieu Moy) is a wrapper (bash scipt) around latexdiff that allows using it to diff two revisions of a LaTeX file under git revision control (similar functionality is provided by latexdiff-vc --git with --flatten option included with this distribution but git-latexdiff allows more fine-grained control on (not to be confused with latexdiff-git, which is normally installed as a soft link to latexdiff-vc) 

LICENSE (also see file COPYING)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3 as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details (file LICENSE in the


Name Notes


Name Size Date Notes
COPYING 32474 2017-06-22 10:45
Make­file 2625 2017-06-22 10:45
README 5296 2017-06-22 10:45
la­texd­iff 186156 2017-06-22 10:45
la­texd­iff_fast 202361 2017-06-22 10:45
la­texd­iff_so 197972 2017-06-22 10:45
la­texd­iff_vc 27946 2017-06-22 10:45
la­texd­iff_vc_1 13440 2017-06-22 10:45
la­texd­iff_1 44976 2017-06-22 10:45
la­texre­vise 19869 2017-06-22 10:45
la­texre­vise_1 9462 2017-06-22 10:45

Down­load the con­tents of this pack­age in one zip archive (487.8k).

la­texd­iff – Deter­mine and mark up sig­nif­i­cant dif­fer­ences be­tween files

La­texd­iff is a Perl script for vi­sual mark up and re­vi­sion of sig­nif­i­cant dif­fer­ences be­tween two files. Var­i­ous op­tions are avail­able for vi­sual markup us­ing stan­dard pack­ages such as color. Changes not di­rectly af­fect­ing vis­i­ble text, for ex­am­ple in for­mat­ting com­mands, are still marked in the source. A rudi­men­tary re­vi­sion fa­cilil­ity is pro­vided by an­other Perl script, la­texre­vise, which ac­cepts or re­jects all changes. Man­ual edit­ing of the dif­fer­ence file can be used to over­ride this de­fault be­haviour and ac­cept or re­ject se­lected changes only.

Li­cense GNU Gen­eral Public Li­cense, ver­sion 3
Copy­right2004–2017 F J Til­mann
Main­tainerFred­erik Til­mann
Con­tained inTeX Live as la­texd­iff
MiKTeX as la­texd­iff
Topics sup­port for keep­ing track of doc­u­ment de­vel­op­ment
Guest Book Sitemap Contact Contact Author