TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a LaTeX beginner and new to Scripting. I try to implement this interesting solution for latexdiff and multiple files found in this question-answer before I begin writing my phd thesis. However using...

  • Win7 (64-bit)
  • GitHub (Sourcetree, Git version 1.8.0msysgit.0)
  • MikTex 2.9
  • ActivePerl version
  • cygwin

and after researching I do not know how to execute the script and the documentation on the site linked above is "sparsely". Here is what I did so far:

  • Latexdiff is installed and successfully tested
  • 'latexbatchdiff.sh' is placed in C:\Users\USER\Dropbox\Github (added to PATH)
  • Repository Path: C:\Users\USER\Dropbox\Github\Testlab

My C:\Users\USER\Dropbox\Github\Testlab\.git\config-file looks like this:

    bare = false
    repositoryformatversion = 0
    filemode = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "origin"]
    url = https://github.com/MYGITHUBACCOUNT/Testlab.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
    cmd = latexdiff "$LOCAL" "$REMOTE"
    prompt = false
    ldiff = difftool -t latex

There is also an 'install.sh' which is not documented at all, so I tried...

trying install.sh and failing

So, how does one execute this script on windows? Do I use the Windows CMD or the Cygwin Terminal? I would be really grateful for a beginner-friendly example.

thats how far I got using cygwin

share|improve this question
the \r means that your install.sh has windows/dos line endings and cygwin wants unix style line endings in the scripts, you can use dos2unix install.sh to get it to have the right endings. – David Carlisle Mar 26 '13 at 21:28
Yes, this helped. Now this is what I get: USER@PC /cygdrive/c/Users/USER/Dropbox/Github/Testlab $ latexdiff-git -bash: latexdiff-git: Kommando nicht gefunden. or USER@PC /cygdrive/c/Users/USER/Dropbox/Github/Testlab $ latexbatchdiff.sh /cygdrive/c/Users/USER/Dropbox/Github/latexbatchdiff.sh: Zeile 5: ldiff: Kommando nicht gefunden. /cygdrive/c/Users/USER/Dropbox/Github/latexbatchdiff.sh: Zeile 21: ldiff: Kommando nicht gefunden. You need to setup the script with a diff command. Please see the README file that came with this script. – FLW Mar 26 '13 at 21:46
er pass I have never actually used latexdiff, but perhaps someone who has could pick it up from here... – David Carlisle Mar 26 '13 at 22:06
ok, so far I couldn't figure it out. Answers still welcome. – FLW Mar 29 '13 at 17:37

The error here is that you want to use MiKTeX with Cygwin. But you must decide:

Either you use MiKTeX in usual Windows mode or you use Cygwin as Unix wrapper and have then to use TeX Live for Unix (i.e. not the Windows version of TL). With TeX Live you do not neede to install a separate Perl distribution (at least not for Tex use), because it comes with an own rudimentary Perl interpreter.

share|improve this answer
@HarishKumar: Yepp. – Speravir Mar 2 '14 at 1:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.