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 need to compile my file in the following way:

pdflatex file.tex
bibtex book
bibtex journals
bibtex conferences
pdflatex file.tex
pdflatex file.tex

Of course, I can build it manually from command line, however, is there any way, how to setup TeXlipse to build it automatically in this way?


well, I know, how to create the script for compilation, the question is, how to force TeXlipse to use my script?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

I think this question doesn't depends on the Editor TeXlipse. So I want to try to answer in a more general way.

Script

To setup your own compilation run you can write your own script. For windows it could be a bat file and for Unix a shell-script. For example a simple script could be:

#!/bin/bash         
# file mycompile
echo "My project compilation"
pdflatex file.tex
bibtex book
bibtex journals
bibtex conferences
pdflatex file.tex
pdflatex file.tex

Now you can configure you editor to run mycompile. This method isn't very flexible.

arara

To setup the compilation run out of your main .tex file you can use arara.

arara must be setup in your editor like pdflatex and then you can use in your header:

% arara: pdflatex 
% arara: bibtex: {inputaux: [book , journals , conferences ] }
% arara: pdflatex
% arara: pdflatex

If you don't need all compilations you can comment them by !. For more details have a look at the documentation: https://github.com/cereda/arara/downloads whereby the final documentation isn't finished yet.

To get the correct identifier inputaux the file bibtex.yaml can be:

!config
identifier: bibtex
name: BibTeX
command: 'bibtex @{expandoptions} 
                 @{inputaux == "" ? file : inputaux}.aux'
arguments:
  - identifier: expandoptions
    flag: '@{value}'
  - identifier: inputaux
    flag: '@{value}'
share|improve this answer
    
well, I know, how to create the script for compilation, the question is, how to force TeXlipse to use my script? –  morph Jun 18 '12 at 2:22
add comment

You can configure TeXlipse to use a custom script through the following steps:

Method 1: Script as part of the build process

This method will include the script as part of the build process, that is, you need to tell TeXlipse to build your project via Ctrl + B, then your script will be executed.

Go to Project > Properties:

Properties

Select the Builders tab and then click the New... button:

New builder

We need to choose which type of builder we want. Select Program, then click OK:

Program

Now, configure your script accordingly (sorry for the shameless self-promotion here):

Edit configuration

Our new tool is now listed in the Builders list. You can check/uncheck the builders you want to use:

My tool

Now, we just need to run it through Project > Build all or via Ctrl + B:

Build all

We can see that the tool was correctly executed (I wrote a dummy directive to force arara to raise an error):

Running

Done. :)

Method 2: Script as an external program

This configuration only sets your script to be manually executed through the Run button.

Click the Run button and select External tools:

External tools

Configure your script accordingly:

Configuration

And now our tool is available in the Run button:

Run tool

Hope it helps. :)

Both methods are project-based, so you need to replicate these steps in other projects.

share|improve this answer
add comment

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.