How to Make a Visual Mark Up and Revision of Significant Differences between Two Latex Files by Latexdiff

Recently my survey was rejected and required minor revision, while I have to submit a revised article with the “editing mode” feature turned on. Because I use Miktex+Texstudio to edit my paper in windows 10, Latexdiff is considered of course.

Latexdiff is a Perl script for visual mark up and revision of significant differences between two LATEX files. Various options are available for visual mark up using standard LATEX packages 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 LATEX 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.

Step 1:

For a pure rookie, first of all, you need to install CTEX (for Chinese users) or Miktex.

Step 2:

Then, win+R and open cmd, input command latexdiff, if returns

1
2 and only 2 non-option arguments required. Write latexdiff -h to get help

Congrats! You have successfully installed latexdiff and you can turn to Step 3.3.

Step 3:

Otherwise, don’t worry, I encountered the same situation as you. Do as follows.

3.1 Install Latexdiff Package

After you install a Tex, open Start Menu->Ctex or Miktex->Package Manager (Admin).

Search Latexdiff in column Name: as follows

Install latexdiff

Click the + button and install it.

3.2 Install Perl

Latexdiff is a Perl script, so you can go to Perl download corresponding version in your computer. Technically, ActivePerl and StrawberryPerl is both ok.

Same steps in Step 2, if you have problem as

1
2
latexdiff: The Perl script could not be found.  
latexdiff: Data: scripts/latexdiff/perl/latexdiff.pl

It’s a common problem and you can find the answer in

这里 or Here.

It is worth mentioning that if you have the following problem which confused me for a long time

1
2
latexmk: the script engine could not be found 
latexdiff: data: scriptengine="perl.exe"

Actually I have no idea how I successfully solve it. You may do the trials as what I have done.

  1. Check the System Path of Perl and Tex, especially according to x86 or x64
  2. Reinstall Perl, if not work, change to ActivePerl or StrawberryPerl
  3. Restart your windows after you make some changes

3.3 Latexdiff

Put your origin tex version (e.g., old.tex) and your modified tex version (e.g., new.tex) in a same file. cmd to this path, and input

1
latexdiff old.tex new.tex >diff.tex

where diff.tex is the editted version, add the required files to this path and compile it. Then you can have the results

Final pdf

If you encounter some errors in compiling, just google it because they are just some common LATEX errors. Enjoy.

!!!Tips: if you suffer any problem, first go to google or baidu it.

Please discover the truth by yourself.

# Latex
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×