[Tex/LaTex] Using a .bat file with TeXlipse

compilingeclipsetexlipse

I use TeXlipse as editor of my choice.

Since I use the nomencl package, I added a .bat file in TeXlipse preferences:

@echo off

pdflatex -synctex=1 -interaction=nonstopmode main.tex
makeindex main.idx
makeindex main.nlo -s nomencl.ist -o main.nls
bibtex main

Now my problem is that every project would use this .bat file in this folder. If I have to swap between two projects I always need to adapt the file.

Is there a way I can specify a .bat file directly in the .tex file, so that I can use a .bat file for a specific project?

Best Answer

You have a different option now: just add

% arara: pdflatex: {synctex: yes, action: nonstopmode}
% arara: makeindex
% arara: nomencl
% arara: bibtex
% arara: pdflatex

at the beginning of your LaTeX file (say main.tex) and change the .bat file into

@echo off

arara main

If you have an uptodate TeX Live 2012, arara will already be available. With MiKTeX 2.9 you have to install it. See https://github.com/cereda/arara for finding the installer and the documentation.