11

Description

I'm new to both Perl and latexdiff. I'd like to use latexdiff to track changes between versions of my LaTeX documents. However I couldn't get it to work.

I have MikTeX 2.9, and latexdiff.exe (and other variants) in

C:\Program Files (x86)\MiKTeX 2.9\miktex\bin

and Strawberry Perl 5.16.3.1 in

C:\StrawberryPerl

When I execute the command

latexdiff old.tex new.tex > diff.tex

I got the following messages:

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

I found a similar question here on tex.se, but I'm not sure if my problem is the same as the one posted there, because I couldn't find the subfolder latexdiff in \MiKTeX 2.9\scripts. Also I don't have any pop-up window asking for installation of other stuff (which is the case in the mentioned post).

Question

  1. Based on the above description, have I installed both Perl and latexdiff properly? Or should they be put on the same path?
  2. If I've installed stuff properly, is there a way to get latexdiff to work (if this is not a bug with MikTeX 2.9)?
Herr K.
  • 17,946
  • 4
  • 61
  • 118
  • 1
    I think the guts of How to make the rmligs script available globally on Windows? might be pretty relevant here- see what you think... – cmhughes Apr 04 '13 at 01:02
  • @cmhughes: Thanks for the pointer! It seems that Perl is already in the system path... I was trying to do something similar for latexdiff, but shouldn't I be looking for a file with extension .pl? I couldn't seem to find it – Herr K. Apr 04 '13 at 02:18
  • 2
    The latexdiff.exe is just a MiKTeX executable that is either supposed to prompt to install the latexdiff perl script (part of the latexdiff MiKTeX package) or to execute said perl script if already installed. As you say you do not have the perl script (but note it may not have the .pl extension), it seems like the latexdiff package is not installed, though it is odd that you are not prompted to install it automatically. Try launching the MiKTeX package manager directly (in Admin mode?) and selecting the latexdiff package for installation. – cyberSingularity Apr 04 '13 at 22:57
  • 1
    @cyberSingularity You're right. I didn't have latexdiff installed before. So I did it in MikTeX's package manager (admin mode). But still, the problem persists, and I'm still getting the same messages in the OP. Are there any other configuration I need to do? After installation, I can find the folder \scripts\latexdiff\, and there is a file latexdiff and its variants. However, the file doesn't have an extension whatsoever. Should I manually add a .pl extension to them? – Herr K. Apr 05 '13 at 16:05
  • 2
    @KevinC: Your error message, if it is to be trusted, does indicate that it is looking for the file with a .pl extension (and possibly in a different subfolder?), so it might be worth copying the script to there to see if it helps. However, before you do that, I wonder if it is worth trying to update the part of your MiKTeX distribution that contains latexdiff.exe (probably called a MiKTeX bin package or something), through the MiKTeX Update (admin) application (or just update everything that has an update available there). – cyberSingularity Apr 05 '13 at 16:59
  • 1
    @cyberSingularity: Thanks for your tips! I'm able to get latexdiff to work now :) It appears that latexdiff is searching for the file latexdiff.pl in the path C:\Program Files (x86)\MiKTeX 2.9\scripts\latexdiff\perl; whereas MikTeX only installs the files in the folder \scripts\latexdiff. So I created a subfolder \perl, copied all the latexdiff files into this new folder, and added the .pl extension to those files (those files originally had no extension). Then, refresh FNDB in MikTeX settings. And now it works! – Herr K. Apr 05 '13 at 21:29

2 Answers2

11

I'll answer my own question here, in case this would turn out to be useful to others.

It appears that latexdiff was searching for the file latexdiff.pl in the path

C:\Program Files (x86)\MiKTeX 2.9\scripts\latexdiff\perl 

whereas MikTeX only installs the files in the folder \scripts\latexdiff. So I created a subfolder \perl, copied all the latexdiff files into this new folder, and added the .pl extension to those files (they originally had no extension). Then, refresh FNDB in MikTeX settings. And it worked!

Herr K.
  • 17,946
  • 4
  • 61
  • 118
  • I did not manage to have latexdiff running on my computer with MikTeX 64bit. I carefully perform all steps described in http://techshangrila.blogspot.sg/2013/10/installing-latexdiff-of-windows.html but still have the error message latexdiff.exe: The Perl interpreter could not be found. What should I do? – Igor Kotelnikov Mar 20 '14 at 12:14
  • @IgorKotelnikov: The message seemed to suggest that you'd need to install Perl (http://strawberryperl.com/releases.html) on your machine. – Herr K. Mar 20 '14 at 17:31
  • I did this and it still gives the same error, it just no longer asks for me to instal latexdiff. – Elliot Jan 15 '15 at 21:55
  • @Elliot: Could you give a bit more details? For example, you system, TeX distribution, error messages, etc. Also, did you have Perl installed already? – Herr K. Jan 15 '15 at 22:16
  • Miktex 2.9 on windows 7x64 using strawberry perl. the error is latexdiff: The Perl script could not be found. latexdiff: Data: scripts/latexdiff/perl/latexdiff.pl Already made a perl folder in the latexdiff folder, added .pl to all the files, and updated the FNDB. – Elliot Jan 15 '15 at 22:24
  • @Elliot: It's strange... One other possibility: Have you tried updating FNDB using both the "admin" mode and the regular mode? Also, you may want to try to copy the perl script files to the MikTeX folder in the user directory, on my machine it's something like C:\Users\<user_name>\AppData\Roaming\MiKTeX\2.9\scripts\latexdiff\perl – Herr K. Jan 16 '15 at 00:53
  • Apparently updating the FNDB must be done in admin mode. Once you do that it will work. – Elliot Jan 16 '15 at 17:52
  • @Elliot: Yeah, this probably has to do with how you initially installed MikTeX (you could select whether to install it for all users on the computer, or just yourself). If it's for all users, then all the updates should be handled in admin mode. At any rate, I'm glad that things worked out. – Herr K. Jan 16 '15 at 18:03
3

There is a step-by-step installation guide here for installing latexdiff for windows http://techshangrila.blogspot.sg/2013/10/installing-latexdiff-of-windows.html

william007
  • 4,781
  • 1
    I did that. Still latexdiff: The Perl script could not be found. latexdiff: Data: scripts/latexdiff/perl/latexdiff.pl. – Elliot Jan 16 '15 at 17:43
  • Apparently once you do all that you must additionally go to the admin settings and refresh the FNDB or it will not work. – Elliot Jan 16 '15 at 17:53