Tuesday, 1 December 2009

[LaTeX] rubber and bibtopic

The freezing temperature of today made me think that this post can be potentially useful to other people out there, sooner or later. I've been struggling, recently, with some missing support for bibtopic in rubber. Let me explain.
  • We are talking about the LaTeX typesetting system.
  • bibtopic is a LaTeX package to insert multiple bibliographies.
  • rubber is an automated builder for LaTex (called, in this case, by the gedit LaTeX plugin).
OK. Now the problem: rubber does not support bibtopic. In particular, the presence of bibtopic requires BibTeX to be called not on the main files (e.g. main.aux), but on several other files (e.g. main1.aux, main2.aux, etc). So the build will always fail.

For some days, I decided to tweak the bibtopic support inside of rubber, a python program that, unfortunately, knows little about object-oriented programming, information hiding, encapsulation, single-responsibility-rule, and so on. Basically, it is almost impossible to modify.

The final solution? Use multibib instead of bibtopic. It's supported by rubber, more modern than bibtopic, and, on top of that, more neatly designed, more flexible, and ultimately easier to use. It took me minutes to switch from the one to the other.