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 have several figures compiled independently into several pdf files. Rubber works great in their compilation. The main document is compiling great with rubber as well.

How can I add dependency (if figure pdf is outdated then recompile) into Rubber?

share|improve this question
1  
Do you mean that you use rubber + pdflatex to compile figure1.tex -> figure1.pdf, and then you have main.tex which uses \includegraphics{figure1.pdf}? –  Jukka Suomela Aug 21 '10 at 13:11
1  
And in that case, a quick'n'dirty solution would be to simply run rubber -Wall figure*.tex && rubber -Wall main.tex. It doesn't re-compile figures if they are already up-to-date. You can write a one-line shell script that does that for you. For a better solution, I'd like to read the manual, but someone has broken the rubber home page, and I can't find documentation any more... –  Jukka Suomela Aug 21 '10 at 13:18
    
That's exactly what I need. –  Łukasz Lew Aug 21 '10 at 14:12
    
Instead of a shell script Makefile would be better. But I thought that rubber intends to replace it! –  Łukasz Lew Aug 21 '10 at 14:15

2 Answers 2

I think you should be able to add something like this in your rules.ini file (I haven't tested this; read the manual and see the predefined examples in rules.ini):

[textopdf]
target = (.*)\.pdf
source = \1.tex
cost = 1
rule = shell
command = rubber -Wall $source
message = converting $source to PDF

This assumes that running rubber -Wall figure1.tex actually generates figure1.pdf.

Note that you don't need to manipulate the "global" share/rubber/rules.ini file; it should be possible to add a directive like % rubber: rules myrules.ini in your main.tex, and then put the above rule in myrules.ini. (Again, I haven't tested this.)

share|improve this answer

Use just the rubber directive watch, by adding just the following line to your latex document:

% rubber: watch figure1.pdf

See rubber man page with

man rubber

to learn everything about rubber directives.

share|improve this answer
    
A late welcome to tex.sx! A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button (with "101010" on it). –  Hendrik Vogt Feb 18 '11 at 10:35

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.