Friday, January 18, 2013

[Latex] 修补Rubber

Rubber停更很久了,所以已经从我的Latex编译好帮手,堕落为了pain of ass.


bibtex 问题



比如编译tex文件的时候会出现如下错误导致bib文件不能正确的编译出来:
running post-compilation scripts...
running BibTeX on paper...
There were errors making the bibliography.
There were errors compiling paper.
这是因为, rubber是这样调用bibtex的
Popen(['bibtex /your/path/to/tex/file'])
而在新的bibtex中, 不能接受绝对路径作为输入参数

解决方法: 在bibtex.py(如果你的rubber是使用brew安装的话, 其路径为/usr/local/Cellar/rubber/20100306/share/rubber/rubber/latex_modules/bibtex.py)中修改run这个函数, 在调用Popen前加上:
cmd = ["bibtex", "-min-crossrefs=1000", msg.simplify(self.base)]
process = Popen(cmd, stdout=PIPE, stderr=PIPE)