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.

How do I do a full build with rubber that does the equivalent of

latex foo
bibtex foo
makeindex -s myindex.ist foo
latex foo
latex foo
dvips foo
ps2pdf foo

The files I am using are

foo.tex
myindex.ist
share|improve this question
1  
Just curious; what are the advantages of Rubber over latexmk? I do it all manually, but I'm interested anyway. –  qubyte Nov 19 '11 at 3:36
1  
rubber --ps --pdf foo.tex is not enough? (man rubber) –  eudoxos Nov 19 '11 at 7:36
1  
Just complementing @eudoxos' comment, to properly set the index style, you can add information for rubber in the comments of your foo.tex file, in the form of directives. A rubber directive goes like this: % rubber: cmd args. In your case, add the following line to your tex file: % rubber: index.style myindex.ist. If you use the makeidx package, add % rubber: makeidx.style myindex.ist instead. There are several directives in which you can set rubber's behaviour. man pages and also info rubber are your friends. Hope it helps. :) –  Paulo Cereda Nov 19 '11 at 9:26
add comment

1 Answer

up vote 10 down vote accepted

Let's consider the foo.tex file. Running

rubber --ps --pdf foo

will correctly produce both ps and pdf outputs. The flags are:

  • --ps: process the DVI produced by the process through dvips to produce a PostScript document. According to the manual, order matters, so it cannot come after the --pdf flag.

  • --pdf: produce PDF output. When this option comes after --ps, it will use ps2pdf instead of pdftex.

rubber will automatically run makeindex for you, but in this case, you want to provide a specific style. In order to properly set the index style for makeindex, you need to add information for rubber in the comments of your foo.tex file, in the form of directives.

A rubber directive goes like this:

% rubber: cmd args

According to the manual, we have a special directive to deal with index styles:

  • index.style <style>: specifies the index style to be used. It's important to note that each of these directives may be used with an optional first argument of the form (foo,bar,quux) in order to specify that the directive only applies to the indexes named foo, bar and quux. By default, directives are applied to all indices.

In your case, considering the myindex.ist style, add the following line to the foo.tex file:

% rubber: index.style myindex.ist
\documentclass{book}
...

An important note from the manual:

  • When using the package makeidx instead of index, the directives must of course be prefixed by makeidx. instead of index., and the optional first argument is not accepted.

So, if you use the makeidx package, add:

% rubber: makeidx.style myindex.ist
\documentclass{book}
...

instead.

There are several directives in which you can set rubber's behaviour. man pages and also info rubber are your friends. I strongly recommend the reading. :)

Disclaimer: We had a new blog post about rubber ready to go, but unfortunately we had to postpone it due to some css issues. This question is a lucky coincidence. :)

share|improve this answer
    
Thanks Paulo Cereda. –  Regis da Silva Nov 20 '11 at 23:59
    
How do I accept that the option -s % Rubber-s makeidx.style indexstyle.ist It's not working: error: "unknown Directive-s" –  Regis da Silva Nov 21 '11 at 0:41
    
@RegisdaSilva: Try to put this line % rubber: makeidx.style indexstyle.ist in the first line of your tex file. :) –  Paulo Cereda Nov 21 '11 at 8:10
    
ok, its work. Thank you. –  Regis da Silva Nov 22 '11 at 0:29
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.