latexdiff-1.0.2/ 0000755 0000764 0000764 00000000000 12063451231 013353 5 ustar tilmann tilmann latexdiff-1.0.2/latexdiff-vc 0000755 0000764 0000764 00000035422 12063450736 015674 0 ustar tilmann tilmann #!/usr/bin/env perl
#
# latexdiff-vc - wrapper script for applying latexdiff to rcs managed files
# and for automatised creation of postscript or pdf from difference file
#
# Copyright (C) 2005-12 F J Tilmann (tilmann@gfz-potsdam.de, ftilmann@users.berlios.de)
#
# Project webpages: http://latexdiff.berlios.de/
# CTAN page: http://www.ctan.org/tex-archive/support/latexdiff
#
#
# Contributors: S Utcke, H Bruyninckx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
# Detailed usage information at the end of the file
#
# version 1.0.2: - option --so to use latexdiff-so
# version 1.0.1 (change version numbering to match that of latexdiff)
# - Option --fast to use latexdiff-fast,
# - git support (thanks to Bjørn Magnus Mathisen, Santi Béjar, Pietro Battiston and Stefan Alfredson for patches) - UNTESTED
# version 0.25:
# - bbl is allowed as alternative extension (instead of .tex)
# version 0.26a
# - Bug fix: it copes now correctly with the possibility that there are no changes between current
# and archived version
use Getopt::Long ;
use Pod::Usage qw/pod2usage/ ;
use File::Temp qw/tempdir/ ;
use File::Basename qw/dirname/;
use strict ;
use warnings ;
my $versionstring=< 1);
# Variables
my ($file1,$file2,$diff,$diffbase,$answer,$options,$infile,$append,$dirname,$cwd);
my (@files,@ldoptions,@tmpfiles,@ptmpfiles,@difffiles); # ,
Getopt::Long::Configure('pass_through','bundling');
GetOptions('revision|r:s' => \@revs,
'cvs' => \$cvs,
'rcs' => \$rcs,
'svn' => \$svn,
'git' => \$git,
'dir|d:s' => \$dir,
'fast' => \$fast,
'so' => \$so,
'postscript|ps' => \$postscript,
'pdf' => \$pdf,
'force' => \$force,
'version' => \$version,
'help|h' => \$help);
if ( $help ) {
pod2usage(1) ;
}
if ( $version ) {
die $versionstring ;
}
if ( $so ) {
$latexdiff='latexdiff-so';
}
if ( $fast ) {
die "Cannot specify more than one of --fast or --so " if ($so);
$latexdiff='latexdiff-fast';
}
if ( $cvs ) {
$vc="CVS";
}
if ( $rcs ) {
die "Cannot specify more than one of --cvs, --rcs --svn or --git." if ($vc);
$vc="RCS";
}
if ( $svn ) {
die "Cannot specify more than one of --cvs, --rcs --svn or --git." if ($vc);
$vc="SVN";
}
if ( $git ) {
die "Cannot specify more than one of --cvs, --rcs, --svn or --git." if ($vc);
$vc="GIT";
}
# check whether the first file name or first passed-through option for latexdiff got misinterpreted as an option to an empty -r option
if ( @revs && ( -f $revs[$#revs] || $revs[$#revs] =~ /^-/ ) ) {
unshift @ARGV,$revs[$#revs];
$revs[$#revs]="";
}
# check whether the first file name or first passed-through option for latexdiff got misinterpreted as an option to an empty -d option
if ( defined($dir) && ( -f $dir || $dir =~ /^-/ ) ) {
unshift @ARGV,$dir;
$dir="";
}
#print "DEBUG: latexdiff-vc command line: ", join(" ",@ARGV), "\n";
$file2=pop @ARGV;
( defined($file2) && $file2 =~ /\.(tex|bbl)$/ ) or pod2usage("Must specify at least one tex or bbl file");
if (! $vc && scalar(@revs)>0 ) {
# have to guess $vc
# check whether we have a special name
if ( $0 =~ /-cvs$/ ) {
$vc="CVS";
} elsif ( $0 =~ /-rcs$/ ) {
$vc="RCS";
} elsif ( $0 =~ /-svn$/ ) {
$vc="SVN";
} elsif ( $0 =~ /-git$/ ) {
$vc="GIT";
} elsif ( -e "CVSROOT" || defined($ENV{"CVSROOT"}) ) {
print STDERR "Guess you are using CVS ...\n";
$vc="CVS";
} elsif ( -e "$file2,v" ) {
print STDERR "Guess you are using RCS ...\n";
$vc="RCS";
} elsif ( -d ".svn" ) {
print STDERR "Guess you are using SVN ...\n";
$vc="SVN";
} elsif ( -d ".git" ) {
print STDERR "Guess you are using GIT ...\n";
$vc="GIT";
} else {
print STDERR "Cannot figure out version control system, so I default to CVS\n";
$vc="CVS";
}
}
if (defined($dir) && $dir=~/^\.\/?/ ) {
print STDERR "You wrote -dir=. but you do not really like to do that, do you ?\n";
exit 10
}
if ( scalar(@revs)>0 ) {
if ( $vc eq "CVS" ) {
$diffcmd = "cvs diff -u -r";
$patchcmd = "patch -R -p0";
} elsif ( $vc eq "RCS" ) {
$diffcmd = "rcsdiff -u -r";
$patchcmd = "patch -R -p0";
} elsif ( $vc eq "SVN" ) {
$diffcmd = "svn diff -r ";
$patchcmd = "patch -R -p0";
} elsif ( $vc eq "GIT" ) {
$diffcmd = "git diff -r --relative --no-prefix ";
$patchcmd = "patch -R -p0";
# alternatively:
# $diffcmd = "git diff ";
# $patchcmd = "patch -R -p1";
} else {
print STDERR "Unknown versioning system $vc \n";
exit 10;
}
}
# make file list (last arguments), initial arguments have to be passed to latexdiff
# We assume an argument is a valid file rather than a latexdiff argument
# if it has extension .tex or .bbl
@files=($file2);
while( $file1=pop @ARGV ) {
if ( $file1 =~ /\.(tex|bbl)$/ ) {
# $file1 looks like a valid file name and is prepended to file list
unshift @files, $file1 ;
} else {
# $file1 looks like an option for latexdiff, push it back to argument stack
unshift @ldoptions, $file1 ;
}
}
if ( scalar(@revs) == 0 ) {
pod2usage("When -r option is not used, two .tex files (old and new) must be given on the command line") unless @files==2;
# compare two files
$file1=shift @files ;
}
if ( scalar(@revs) == 2 ) {
$append = "-diff$revs[0]-$revs[1]";
} elsif ( scalar(@revs) == 1 || $revs[0] ) {
$append = "-diff$revs[0]";
} else {
$append = "-diff";
}
if ( defined ($dir) && ! $dir ) {
# bare -d option => choose directory name
($dir=$append) =~ s/^-//;
}
if ( ($vc eq "SVN" || $vc eq "CVS") && scalar(@revs)) {
length($revs[$#revs]) > 0 or $revs[$#revs]="HEAD";
length($revs[0]) > 0 or $revs[0]="HEAD";
}
#exit ;
# cycle through all files
@difffiles=();
while ( $infile=$file2=shift @files ) {
print STDERR "Working on $infile \n";
if ( scalar(@revs) == 1 ) {
($file1=$infile) =~ s/\.(tex|bbl)/-oldtmp-$$.$1/ ;
push @tmpfiles,$file1;
# compare file with previous version ($revs[0]="") or specified version
### system("$diffcmd$revs[0] $infile| $patchcmd -o$file1") ;
if (system("$diffcmd$revs[0] $infile | $patchcmd -o$file1")==0 and -z $file1 ) {
# no differences detected, i.e. file is equal to current version
system("\cp $infile $file1");
}
} elsif ( scalar(@revs) == 2 ) {
($file1=$infile) =~ s/\.(tex|bbl)/-oldtmp-$$.$1/ ;
$file2 =~ s/\.(tex|bbl)/-newtmp-$$.$1/ ;
push @tmpfiles,$file2;
;
if (system("$diffcmd$revs[1] $infile | $patchcmd -o$file2")==0 and -z $file2 ) {
system("\cp $infile $file2");
}
if (system("$diffcmd$revs[0] $infile | $patchcmd -o$file1")==0 and -z $file1 ) {
system("\cp $infile $file1");
};
}
if ( -z $file1 || -z $file2) {
print STDERR "One or both of the files to compare are empty. Possibly something went wrong in the retrieval of older versions. Aborting ...\n" ;
exit(10);
}
# Get name of difference file
if ( defined($dir) ) {
$diff="$dir/$infile" ;
} else {
($diff=$infile) =~ s/\.(tex|bbl)$/$append.$1/ ;
}
# make directories if needed
$dirname=dirname($diff) ;
system("mkdir -p $dirname") unless ( -e $dirname );
# Remaining options are passed to latexdiff
$options = join(" ",@ldoptions);
if ( -e $diff && ! $force ) {
print STDERR "OK to overwrite existing file $diff (y/n)? ";
$answer = ;
unless ($answer =~ /^y/i ) {
unlink @tmpfiles;
die "Abort ... " ;
}
}
print "Running $latexdiff\n";
unless ( system("$latexdiff $options $file1 $file2 > $diff") == 0 ) {
print STDERR "Something went wrong in $latexdiff. Deleting $diff and abort\n" ; unlink $diff ; exit(5)
};
print "Generated difference file $diff\n";
if ( ( $postscript or $pdf ) and !( scalar(@revs) && greptex( qr/\\document(?:class|style)/ , $diff ) ) ) {
# save filename for later processing if postscript or pdf conversion is requested and either two-file mode was used (scalar(@revs)==0) or the diff file contains documentclass statement (ie. is a root document)
push @difffiles, $diff ;
}
unlink @tmpfiles;
}
foreach $diff ( @difffiles ) {
chomp($cwd=(`pwd`));
if (defined($dir)) {
( $diff =~ s/$dir\/?// ) ;
chdir $dir ;
}
@ptmpfiles=();
( $diffbase=$diff) =~ s/\.(tex)$// ;
# adapt magically changebar styles to [pdftex] display driver if pdf output was selected
if ( $pdf ) {
system("sed \"s/Package\\[dvips\\]/Package[pdftex]/\" $diff > $diff.tmp$$ ; \\mv $diff.tmp$$ $diff");
}
print STDERR "PDF: $pdf Postscript: $postscript cwd $cwd\n";
if ( system("grep -q \'^[^%]*\\\\bibliography\' $diff") == 0 ) {
if ( $postscript) {
system("latex --interaction=batchmode $diff; bibtex $diffbase");
push @ptmpfiles, "$diffbase.bbl","$diffbase.bbl" ;
} elsif ( $pdf ) {
system("pdflatex --interaction=batchmode $diff; bibtex $diffbase");
push @ptmpfiles, "$diffbase.bbl","$diffbase.bbl" ;
}
}
if ( $postscript ) {
my $dvi="$diffbase.dvi";
my $ps="$diffbase.ps";
system("latex --interaction=batchmode $diff; latex $diff; dvips -o $ps $dvi");
push @ptmpfiles, "$diffbase.aux","$diffbase.log",$dvi ;
print "Generated postscript file $ps\n";
}
elsif ( $pdf ) {
system("pdflatex --interaction=batchmode $diff; pdflatex $diff");
push @ptmpfiles, "$diffbase.aux","$diffbase.log";
}
unlink @ptmpfiles;
chdir $cwd;
}
# greptex returns 1 if regex is not matched in filename
# 0 if there is a match
sub greptex {
my ($regex,$filename)=@_;
my ($i)=0;
open (FH, $filename) or die("Couldn't open $filename: $!");
while () {
next if /^\s*%/; # skip comment lines
if ( m/$regex/ ) {
close(FH);
return(0);
}
# only scan 25 lines
$i++;
last if $i>25 ;
}
close(FH);
return(1);
}
=head1 NAME
latexdiff-vc - wrapper script that calls latexdiff for different versions of a file under version management (CVS, RCS or SVN)
=head1 SYNOPSIS
B [ F ] [ F ] B<-r> [F] [B<-r> F] F [ F ...]
or
B [ F ] [ F ][ B<--postscript> | B<--pdf> ] F F
=head1 DESCRIPTION
I is a wrapper script that applies I to a
file, or multiple files under version control (CVS, RCS or SVN), and optionally runs the
sequence of C and C or C commands necessary to
produce pdf or postscript output of the difference tex file(s). It can
also be applied to a pair of files to automatise the generation of difference
file in postscript or pdf format.
=head1 OPTIONS
=over 4
=item B<--rcs>, B<--svn>, B<--cvs>, or B<--git>
Set the version system.
If no version system is specified, latexdiff-vc will venture a guess.
latexdiff-cvs and latexdiff-rcs are variants of latexdiff-vc which default to
the respective versioning system. However, this default can still be overridden using the options above.
=item B<-r>, B<-r> F or B<--revision>, B<--revision=>F
Choose revision (under RCS, CVS, SVN or GIT). One or two B<-r> options can be
specified, and they result in different behaviour:
=over 4
=item B -r F ...
compares F with the most recent version checked into RCS.
=item B -r F F ...
compares F with revision F.
=item B -r F -r F F ...
compares revisions F and F of F.
Multiple files can be specified for all of the above options. All files must have the
extension C<.tex>, though.
=item B F F
compares two files.
=back
The name of the difference file is generated automatically and
reported to stdout.
=item B<-d> or B<--dir> B<-d> F or B<--dir=>F
Rather than appending the string C and optionally the version
numbers given to the output-file, this will prepend a directory name C
to the
original filename, creating the directory and subdirectories should they not exist already. This is particularly useful in order to clone a
complete directory hierarchy. Optionally, a pathname F can be specified, which is prepended instead of C.
=item B<--fast> or B<--so>
Use C or C, respectively (instead of C).
=item B<--ps> or B<--postscript>
Generate postscript output from difference file. This will run the
sequence C on the difference file (do not use
this option in the rare cases, where three C commands are
required if you care about correct referencing). If the difference
file contains a C<\bibliography> tag, run the sequence C.
=item B<--pdf>
Generate pdf output from difference file using C. This will
run the sequence C on the difference file, or
C for files requiring bibtex.
=item B<--force>
Overwrite existing diff files without asking for confirmation. Default
behaviour is to ask for confirmation before overwriting an existing difference
file.
=item B<--help> or
B<-h>
Show help text
=item B<--version>
Show version number
=back
All other options are passed on to C.
=head1 SEE ALSO
L
=head1 PORTABILITY
I uses external commands and is therefore
limited to Unix-like systems. It also requires the RCS version control
system and latex to be installed on the system. Modules from Perl 5.8
or higher are required.
=head1 BUG REPORTING
Please submit bug reports through
the latexdiff project page I or send
to I. Include the serial number of I
(option C<--version>)
.
=head1 AUTHOR
Copyright (C) 2005,2012 Frederik Tilmann
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
Contributors: S Utcke, H Bruyninckx
=cut
latexdiff-1.0.2/doc/ 0000755 0000764 0000764 00000000000 12063451231 014120 5 ustar tilmann tilmann latexdiff-1.0.2/doc/latexdiff-man.tex 0000644 0000764 0000764 00000025237 12063450740 017376 0 ustar tilmann tilmann \documentclass[a4]{article}
\usepackage{graphicx}
%\def\C++{{\rm C\kern-.05em\raise.3ex\hbox{\footnotesize ++}}}
%\def\underscore{\leavevmode\kern.04em\vbox{\hrule width 0.4em height 0.3pt}}
\setlength{\parindent}{0pt}
%\setlength{\textwidth}{6.5in}
%\setlength{\oddsidemargin}{0.0in}
\title{Marking up differences between latex files with {\em latexdiff}}
\author{F.J. Tilmann\thanks{tilmann@gfz-potsdam.de,ftilmann@users.berlios.de}}
\date{\today}
\begin{document}
\maketitle
\section*{Preamble}
{\em latexdiff} is a Perl script, which compares two
latex files and marks up significant differences between them. Various options are available for visual markup using standard
latex packages such as {\em color.sty}. Changes not directly affecting visible
text, for example in formatting commands, are still marked in the
latex source.
A rudimentary revision facilility is provided by another Perl script,
{\em 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.
There is no explicit support for annotations as these are trivial to implement.
For example, I include the following command definition in the preamble
\begin{verbatim}
\newcommand{\remark}[1]{{ \bf [ \footnotesize #1 ]}}
\end{verbatim}
and mark up annotations as follows
\begin{verbatim}
... The roadrunner is the fastest running bird \remark{Check this
again with a zoologist!}. The most famous roadrunner ...
\end{verbatim}
Alternatively, instead of a command like \verb#\remark# in the example just given, an
equivalent annotation environment could be defined.
{\em latexrevise} can remove such comments or
environments from the text body.
%It is planned that the revision capabilities of this system will be
%further expanded, dependent on the amount of feedback received.
On the following pages you find the {\em man} pages for {\em
latexdiff} and {\em latexrevise} and a simple example.
\include{latexdiff}
\setcounter{section}{0}
\include{latexrevise}
\setcounter{section}{0}
\include{latexdiff-vc}
\setcounter{section}{0}
\section*{A simple example}
We start with a draft text, \verb|example-draft.tex|, listed here in
full but also included in the distribution (except that the ``verbatim'' environment had
to be renamed to ``Verbatim'' for the listing).
{\scriptsize
\begin{verbatim}
\documentclass[12pt,a4paper]{article}
\setlength{\topmargin}{-0.2in}
\setlength{\textheight}{9.5in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\textwidth}{6.5in}
\title{latexdiff Example - Draft version}
\author{F Tilmann}
\begin{document}
\maketitle
\section*{Introduction}
This is an extremely simple document that showcases some of latexdiff features.
Type
\begin{Verbatim}
latexdiff -t UNDERLINE example-draft.tex example-rev.tex > example-diff.tex
\end{Verbatim}
to create the difference file. You can inspect this file directly. Then run either
\begin{Verbatim}
pdflatex example-diff.tex
xpdf example-diff.pdf
\end{Verbatim}
or
\begin{Verbatim}
latex example-diff.tex
dvips -o example-diff.ps example-diff.dvi
gv example-diff.ps
\end{Verbatim}
to display the markup. Of course, instead of \verb|xpdf| you can use
\verb|okular, evince, acroread| or any other pdf or postscript viewer.
\section*{Another section title}
A paragraph with a line only in the draft document. More things
could be said were it not for the constraints of time and space.
More things could be said were it not for the constraints of time and space.
And here is a tipo.
Here is a table:
\begin{tabular}{ll}
Name & Description \\
\hline
Gandalf & Grey \\
Saruman & White
\end{tabular}
And sometimes a whole paragraph gets completely rewritten. In this
case latexdiff marks up the whole paragraph even if some words in it
are identical.
No change, no markup!
\end{document}
\end{verbatim}
}
We can now edit
this text as we would do with any other latex file to create
a new revision of the text, \verb|example-rev.tex|. We should run
\begin{verbatim}
latex example-rev.tex
\end{verbatim}
and look at the resulting \verb|.dvi| file to make sure that all
changes are valid. An example revision is listed here:
{\scriptsize
\begin{verbatim}
\documentclass[12pt,a4paper]{article}
\setlength{\topmargin}{-0.2in}
\setlength{\textheight}{9.5in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\textwidth}{6in}
\title{latexdiff Example - Revised version}
\author{F Tilmann}
% Note how in the preamble visual markup is never used (even
% if some preamble might eventually end up as visible text.)
\begin{document}
\maketitle
\section*{Introduction}
This is an extremely simple document that showcases some of the latexdiff features.
Type
\begin{Verbatim}
latexdiff -t UNDERLINE example-draft.tex example-rev.tex > example-diff.tex
\end{Verbatim}
to create the difference file. You can inspect this file directly. Then run either
\begin{Verbatim}
pdflatex example-diff.tex
xpdf example-diff.pdf
\end{Verbatim}
or
\begin{Verbatim}
latex example-diff.tex
dvips -o example-diff.ps example-diff.dvi
gv example-diff.ps
\end{Verbatim}
to display the markup.
\section*{Yet another section title}
More things could be said were it not for the constraints of time and space.
A paragraph with a line only in the revised document.
More things could be said were it not for the constraints of time and space.
And here is a typo.
Here is a table:
\begin{tabular}{ll}
Name & Description \\
\hline
Gandalf & White \\
Saruman & Evil
\end{tabular}
And now for something completely different, with not a paragraph in sight.
No change,
no markup!
\end{document}
\end{verbatim}
}
To compare both revisions, type
\begin{verbatim}
latexdiff -t UNDERLINE example-draft.tex example-rev.tex > example-diff.tex
\end{verbatim}
This results in the following difference file (a few newlines have been
added in this listing for legibility reasosn):
{\scriptsize
\begin{verbatim}
\documentclass[12pt,a4paper]{article}
\setlength{\topmargin}{-0.2in}
\setlength{\textheight}{9.5in}
\setlength{\oddsidemargin}{0.0in}
%DIF 7c7
%DIF < \setlength{\textwidth}{6.5in}
%DIF -------
\setlength{\textwidth}{6in} %DIF >
%DIF -------
%DIF 9c9
%DIF < \title{latexdiff Example - Draft version}
%DIF -------
\title{latexdiff Example - Revised version} %DIF >
%DIF -------
\author{F Tilmann}
% Note how in the preamble visual markup is never used (even %DIF >
% if some preamble might eventually end up as visible text.) %DIF >
%DIF PREAMBLE EXTENSION ADDED BY LATEXDIFF
%DIF UNDERLINE PREAMBLE %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\color{blue}\uline{#1}}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\color{red}\sout{#1}}} %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF
\begin{document}
\maketitle
\section*{Introduction}
This is an extremely simple document that showcases some of latexdiff features.
Type
\begin{Verbatim}
latexdiff -t UNDERLINE example-draft.tex example-rev.tex > example-diff.tex
\end{Verbatim}
to create the difference file. You can inspect this file directly. Then run either
\begin{Verbatim}
pdflatex example-diff.tex
xpdf example-diff.pdf
\end{Verbatim}
or
\begin{Verbatim}
latex example-diff.tex
dvips -o example-diff.ps example-diff.dvi
gv example-diff.ps
\end{Verbatim}
to display the markup.
\section*{\DIFaddbegin \DIFadd{Yet another }\DIFaddend \DIFdelbegin
\DIFdel{Another }\DIFdelend section title}
\DIFdelbegin \DIFdel{A paragraph with a line only in the draft
document. }\DIFdelend More things could
be said were it not for the constraints of time and space.
\DIFaddbegin \DIFadd{A paragraph with a line only in the revised
document. }\DIFaddend More things could be said
were it not for the constraints of time and space.
And here is a \DIFaddbegin \DIFadd{typo}\DIFaddend \DIFdelbegin
\DIFdel{tipo}\DIFdelend .
Here is a table:
\begin{tabular}{ll}
Name & Description \\
\hline
Gandalf & \DIFaddbegin \DIFadd{White }\DIFaddend \DIFdelbegin
\DIFdel{Grey }\DIFdelend \\
Saruman & \DIFaddbegin \DIFadd{Evil
}\DIFaddend \DIFdelbegin \DIFdel{White
}\DIFdelend \end{tabular}
And \DIFaddbegin \DIFadd{now for something completely different, with not
a paragraph in sight}\DIFaddend \DIFdelbegin \DIFdel{sometimes a whole
paragraph gets completely rewritten. In this
case latexdiff marks up the whole paragraph even if some words in it
are identical}\DIFdelend .
No change,
no markup!
\end{document}
\end{verbatim}
}
Type
\begin{verbatim}
pdflatex example-diff.tex
xpdf example-diff.pdf
\end{verbatim}
to make the markup visible. This is what it looks like:
\vspace{1cm}
\framebox[\textwidth]{\includegraphics[width=\textwidth]{example-diff}}
\vspace{1cm}
If you approve of all the changes in the revision, just continue with
\verb|example-rev.tex| for the next revision. If you like to adopt
most but not all changes you can use \verb|latexrevise| in the
following manner. Simply remove the \verb|\DIFdelbegin| and
\verb|\DIFdelend| tags around the text you would like to keep and
simply remove the text between \verb|\DIFaddbegin| and
\verb|\DIFaddend| tags, if you do not wish to keep them. Say you are happy with all proposed changes for the
example above except in
the last paragraph where you prefer the original draft. You have
to change
{\scriptsize
\begin{verbatim}
...
And \DIFaddbegin \DIFadd{now for something completely different, with not
a paragraph in sight}\DIFaddend \DIFdelbegin \DIFdel{sometimes a whole
paragraph gets completely rewritten. In this
case latexdiff marks up the whole paragraph even if some words in it
are identical}\DIFdelend .
...
\end{verbatim}
}
into
{\scriptsize
\begin{verbatim}
...
And \DIFdel{sometimes a whole
paragraph gets completely rewritten. In this
case latexdiff marks up the whole paragraph even if some words in it
are identical}.
...
\end{verbatim}
}
and run
\begin{verbatim}
latexrevise -a example-rev.tex > example-final.tex
\end{verbatim}
\verb|example-final.tex| is then almost identical to
\verb|example-rev.tex| except for the last paragraph.
\end{document}
latexdiff-1.0.2/doc/latexdiff-man.pdf 0000644 0000764 0000764 00000572307 12063450740 017354 0 ustar tilmann tilmann %PDF-1.4
%
3 0 obj <<
/Length 1634
/Filter /FlateDecode
>>
stream
xڕWK6WE֬Dݚ
ASeDLp$y7p({U|z[FiDŽK۶n+v\R䱵-f_SNܻqY535`EE+Y5еLqXOSgV噂#ӑ@ӶtP(gEp<,bR{>&Z0%ܐ\+-m`qO
< Rq!:Z9i@CoM