I am trying to use latexdiff
to compare two .tex files, producing a .pdf with a markup similar to the "track changes" function in Microsoft Word (see https://www.sharelatex.com/blog/2013/02/16/using-latexdiff-for-marking-changes-to-tex-documents.html).
I have downloaded the latexdiff
files from CTAN and I have also downloaded Strawberry Perl. I am using MiKTeX to compile my two tex documents.
In the command line (DOS prompt) I have been trying to instruct latexdiff
to compare two very simple .tex files: SAMPLE4.tex
and SAMPLE5.tex
. I have been following the instructions in the USAGE section of the first URL I list here ("…using latexdiff…"), specifically:
"Usage
To compare two documents simply run latexdiff in the command line like so:
latexdiff draft.tex revision.tex > diff.tex"
However, when I enter the following into the command line:
C:\Users\Kathryn\latexdiff SAMPLE4.tex SAMPLE5.tex > diff.tex
I get the following error message:
Input file SAMPLE$.tex does not exist. at C:\Program Files\MiKTeX 2.9\scripts\latexdiff\latexdiff line 513, <DATA> line 20026.
I suspect the problem is that the computer cannot find the file SAMPLE4.tex
and that I need to make SAMPLE4.tex
(and presumably also SAMPLE5.tex
) available in a directory that I can accurately specify in DOS.
I tried putting my two .tex files in C:\Program Files\MikTeX 2.9\latexdiff
but this did not work.
Can anyone here offer me some advice?
Best Answer
I had no issues with this on first attempt and this is what I did. I use MiKTeX on Windows 8.
I used MiKTeX Package Manager (admin) to install
latexdiff
.I downloaded and installed Strawberry Perl.
I searched for "cmd" on start menu/window search and saw
perl(command line)
I opened
perl(command line)
and changed directory to the directory where myoldfile.tex
andnewfile.tex
was (both in same folder).Then I executed
latexdiff oldfile.tex newfile.tex > diff.tex
on the shell prompt.It generated a
diff.tex
file in the same folder which I compiled using MiKTeX to get thediff.pdf
file.