1

I am trying to use latexdiff to compare two tex documents on my pc. I use TexLive to compile my latex documents. I know the latexdiff package is already installed with under C:\texlive\2016\bin\win32 folder, but I do not know how to use it. My questions are:

  1. how to use latexdiff? do I click latexdiff then the Terminal shows up? then do I write the command there latexdiff old.tex new.tex > diff.tex? I have tried this, but I could not write anything in the Terminal (a terminal appears but just for less than 1 second).
  2. if I want to compare two tex files, where or under what path should I put these two tex files?
  3. do I run latexdiff script in TexLive with macros or applyscript?

I hope someone can help me, please!!

5
  • Welcome to TeX.SX! Have you read the manual?
    – TeXnician
    Jun 23, 2017 at 15:58
  • Yes I do. I installed pearl script and I tried to run latexdiff (since pearl), but i don´t know why i can´t write in the terminal. Jun 23, 2017 at 16:14
  • with texmaker panel "source viewer" can help to find differences between two files
    – Salim Bou
    Jun 23, 2017 at 16:54
  • The terminal probably opens and closes because the command is run without arguments, which is not a valid mode, so it closes with an error message (which you can't see because the window closes even before there was enough time to print the message).
    – frederik
    Jun 24, 2017 at 14:24
  • You need to open the terminal first (in Windows 7 and maybe other version, too, type cmd in search box, or find "command line prompt" or similar in Accesoires in Menu). Then run latexdiff from there (you might need to be some basic Windows command line basics).
    – frederik
    Jun 24, 2017 at 14:41

2 Answers 2

0
  1. Run "Windows PowerShell".
  2. Run the command latexdiff old.tex new.tex > diff.tex in the PowerShell.
  3. Compile diff.tex with TexLive or TexStudio.
0

First of all, create a new folder and copy a old tex file and a new tex file into it.

  1. Ensure your Texlive was installed rightly
  2. Press windows+r on your keyboard
  3. Input cmd and press the Enter key
  4. Input latexdiff and press Enter key

if it shows as follow:

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

that means you can use latexdiff in your computer. Otherwise, you may need to install Perl.

  1. Input drive letter+: and press the Enter key to enter the drive where the tex files exist.

for example:

e:
  1. Input cd + folder name and press the Enter key to enter the folder where the tex files exist.

for example:

cd difffolder
  1. Input latexdiff + space + old file name + space + new file name + space + > + space + diff.tex and press the Enter key

for exapmle:

latexdiff old.tex new.tex > diff.tex 
  1. Then there will create a diff.tex file in the folder automatically. Run diff.tex, and you will get a compared pdf file.

Ps: if it appears errors, try the following code:

latexdiff origin.tex modify.tex > diff.tex --encoding=ascii

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .