scons没有找到LaTeX DVI构建器

时间:2010-02-11 14:18:05

标签: latex scons

我在运行Snow Leopard的iMac上安装了MacTex-2009(来自http://www.tug.org/mactex/2009/)和scons(1.2.0)。然后我用一个简单的SConstruct文件测试了安装:

    env = Environment()
    dvi = env.DVI(target="hello.dvi",source="hello.tex")

和一个明显的LaTeX“hello.tex”文件。当我执行“scons”时,我得到:

    scons: Reading SConscript files ...
    AttributeError: SConsEnvironment instance has no attribute 'DVI':
      File "/Users/tsf/temp/SConstruct", line 2:
        dvi = env.DVI(target="hello.dvi",source="hello.tex")

在第一行之后我添加了命令:

    print str(env["BUILDERS"])

我可以看到DVI构建器没有出现。我在Linux机器上使用相同的文件(不同的TeX安装),它可以工作。

任何提示?

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。似乎scons没有找到MacTex-2009,因此SConstruct文件应该如下所示:

    import os
    env = Environment(ENV = os.environ)
    dvi = env.DVI(target="hello.dvi",source="hello.tex")

现在有效!

- Tsf