2010-02-11 44 views
2

我在运行Snow Leopard的iMac上安装了MacTex-2009(从http://www.tug.org/mactex/2009/)和scons(1.2.0)。然后,我测试了一个简单的SConstruct文件安装:scons找不到LaTeX DVI生成器

 
    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安装)并且它可以工作。

任何提示?

回答

0

我已经解决了这个问题。看来,使用SCons没有找到MacTEX都-2009,从而使SConstruct文件应该是这样的:

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

现在,它的作品!

- Tsf