1TEXDIFF(1) User Contributed Perl Documentation TEXDIFF(1)
2
3
4
6 texdiff - Compares two (La)TeX documents to create a merged version
7 showing changes, similar to that of 'Change Tracking' in some word pro‐
8 cessors.
9
11 texdiff [--nofloats⎪-n] old.tex new.tex [diff.tex]
12
14 The first two files are compared and a new TeX file is output. When the
15 output file is processed with (La)TeX it marks new changes with blue
16 and old text with red with a strike-through line. Furthermore, passages
17 with changes are marked at the margin with grey bars by the LaTeX
18 "changebar" package (although only after running "dvips", in "xdvi" the
19 bars are one inch too far left to compensate the one inch offset
20 inserted by TeX printer drivers).
21
22 "texdiff" uses and therefore requires the "wdiff" command to insert
23 these marks. If LaTeX macros are included in those striked out or
24 underlined passages, the latex run will most likely fail. The source of
25 most problems lies in "wdiff" tearing apart pairs of braces. Therefore
26 "texdiff" is a perl script that calls "wdiff" internally and fixes
27 "wdiff"'s output by re-pairing braces again and handling some commonly
28 used LaTeX macros.
29
30 For texdiff to work, the following LaTeX code must be inserted in the
31 preamble of the LaTeX document:
32
33 \usepackage{xcolor} \usepackage{ulem} \usepackage{changebar}
34 \newcommand\TLSins[1]{\cbstart{}\textcolor{ins}{\uline{#1}}\cbend{}}
35 \newcommand\TLSdel[1]{\cbdelete{}\textcolor{del}{\sout{#1}}}
36
37 Define editing colors "ins" and "del" with existing "xcolor" color
38 names:
39 \colorlet{ins}{blue} \colorlet{del}{red}
40
41 Or from scratch:
42 \definecolor{ins}{rgb}{0, 0.5, 0}
43
44 These macros are NOT automatically interted at \begin{document} like
45 the original scripts did (see the ACKNOWLEDGMENTS section below),
46 because this will not work on files of a multi-file document (those
47 included by \include or \input). Furthermore, if you insert the macros
48 manually, you can tune them as you like, i. e. change text color or
49 position of changebars. Have a look at the documentation of the ulem
50 and changebar packages on how to do this!
51
53 --nofloats, -n
54 If given, skips contents of figure environments, but does show
55 insertions and deletions in the caption commands. This is done to
56 avoid complex messups in subfloat or complex figure environments.
57
58 --debug, -d
59 Turns on debugging. Temporary files that contain numbered braces
60 are kept and a raw difference file is written as output file name
61 appended with '-wdiff.tex'. In addition, several regular expression
62 diagnostics are printed. Warning: produces a lot of output.
63
65 Mark Doll <markdoll<AT>gmx.net>, Cengiz Gunay
66 <cengique<AT>users.sf.net>.
67
69 * Version 0.4, by CG, 2009/09/15. Added use of GetOpt to take an
70 optional parameter to skip float (e.g., figure or table) contents.
71 Added an optional debug mode. Embedded POD documentation. Fixed
72 problem with insertion and deletions appearing in the middle of
73 sectioning commands by throwing off LaTeX.
74
75 * Version 0.3, modified by Cengiz Gunay <cengique@users.sf.net>,
76 2009/06/30. Added some Latex commands that should be excluded and
77 fixed handling of '\%' characters.
78
79 * Version 0.2, is a perl implementation of TeXdiff by Mark Doll
80 <markdoll@gmx.net>, 2006/08/09. It was derived from the original
81 bash and perl scripts created by Robert Maron <rob‐
82 mar@mimuw.edu.pl>, available at http://www.robmar.net/TexDiff/.
83 This version of texdiff is available at http://mark.doll.name/texd‐
84 iff/.
85
87 Copyleft 2006-2009, Mark Doll and Cengiz Gunay
88
89 This library is free software; you may redistribute it and/or modify it
90 under the same terms as Perl itself.
91
92
93
94perl v5.8.8 2009-09-24 TEXDIFF(1)