Monday, April 03, 2006

LaTeX compilation with 'rubber'

My main desktop died last week and I reinstalled from scratch (I had everything safe on a backup, not to worry). This gave me a chance to upgrade all my software, and things are working great now. I really like the x.org server and globally antialiased fonts, and other nice minor features.

What has made my day, however, is the 'rubber' tool. I do a lot of writing, and most of it in tex. It's always been irritating to have to manage dependencies, makefiles, etc. all by hand. Now, I just have a makefile I can dump anywhere and it works like magic!


TARGET_FORMAT=ps
#TARGET_FORMAT=pdf

PROBLEMS:=${shell ls *.tex}

all: figures ${PROBLEMS:.tex=.${TARGET_FORMAT}}
gvwatch ${PROBLEMS:.tex=.${TARGET_FORMAT}}

%.pdf:%.tex
rubber --pdf $<

%.ps:%.tex
rubber --ps $<

figures:
$(MAKE) -C figures

clean:
$(MAKE) -C figures clean
rm -f *.{aux,bbl,blg,dvi,log,ps,pdf} texput.log *~


I love cool little tools that make my life easier.

1 comment:

Claire Connelly said...

FYI, rubber has a --clean option that will do most or all of the cleanup for you.

(You only have a subset of possible auxiliary file extensions in your clean target; there are oh so many more you could encounter....)