1 Answer
1

The script provided in the multibib documentation is Unix-based, so we will have troubles running it in Windows. In the script, there's also another command running inside single quotes - basename $file .aux - which returns the full path for $file (which is the current element in the for loop).

The solution is to manually run these commands in the following order:

pdflatex mydoc
bibtex mydoc
bibtex sec
pdflatex mydoc
pdflatex mydoc

As Mico suggested in the comments, you can also create a Windows-equivalent batch file. It's been a while since my last Windows batch file, but I'm almost sure we can use this one:

@echo off
FOR %%A IN (*.aux) DO bibtex %%A

Save it as myscript.bat. It will run bibtex on all .aux files in the current directory. Now, I think TeXworks might not run the batch file in the current directory, so we need to change things a little:

@echo off
FOR %%A IN (*.aux) DO bibtex %1\%%A

and then make TeXworks call myscript.bat with $directory as argument (note that $directory is a TeXworks variable which expands to the absolute path to the directory containing your root document).

Another suggestion (and sorry for tooting my own horn here) is to use arara to automate your document compilation. The header would be:

wow thanks for the comprehensive answer, that worked sweetly! I gave a look at arara and it is very interesting (I do love palindrome myself), but I'm not sure I can understand how to make it work at its full potentiality in a reasonable time
–
scannerdarklyAug 7 '12 at 12:26

@scannerdarkly Yay, I'm glad it worked! :) By the way, don't worry about arara, it really takes some time to grasp the concepts - it might not be intuitive in the first couple of tries. :P
–
Paulo CeredaAug 7 '12 at 12:55

I am TOTALLY confused...how a commented command can run in latex editor?
–
TashJun 9 '14 at 0:38