Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Is not possible to use a kind of variable to the main file? Something like %f.tex? –  Sigur Jul 3 '12 at 22:32

2 Answers 2

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 http://cereda.github.com/arara/ for finding the installer and the documentation.

share|improve this answer

In the builder of Texlipse you can call your .bat as usual and in the arguments pour %input.

enter image description here

Then in your .bat you can do

@echo off
cd "%~dp1"
set texSource=%~n1

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

Also, I suggest you look at using LatexMK which, after you installed Perl, allows you to replace all that above with

latexmk -pdflatex="pdflatex -file-line-error -synctex=1" -pdf "%texSource%" -r latexmk

for instance.

share|improve this answer

Your Answer

 
discard

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.