Sublime 中的自定义构建设置

Sublime 中的自定义构建设置

我在用着Latex工具对于 Sublime 2。我想将参数添加-shell-escape到构建命令中,但很费劲。文档说不要编辑“LaTeX.sublime-build”,而是编辑“LaTeXTools.sublime-settings”。我尝试这样做,设置"builder": "script"和构建设置如下:

"builder_settings" : {

    // General settings:
    // See README or third-party documentation

    // (built-ins): true shows the log of each command in the output panel
    "display_log" : true,   

    // Platform-specific settings:
    "osx" : {
        // See README or third-party documentation
        "program": "pdflatex",
        "command": ["latexmk", "-cd", "-e", "$pdflatex = '%E -interaction=nonstopmode -synctex=1 %S %O'", "-f", "-pdf"]
        // "cmd": ["latexmk", "-cd",
        //  "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",
        //  //"-silent",
        //  "-shell-escape",
        //  "-f", "-pdf"]
    },

    "windows" : {
        // See README or third-party documentation
    },

    "linux" : {
        // See README or third-party documentation
    }
},

我认为这就是我需要的。但现在当我尝试构建某些东西时,什么也没有发生。

对于该做什么有什么建议吗?

答案1

对我有用的是添加"options": ["--shell-escape"],builder_settings。整个块对我来说看起来像这样:

"builder_settings" : {

    // General settings:
    // See README or third-party documentation

    // (built-ins): true shows the log of each command in the output panel
    "display_log" : false,
    "options": ["--shell-escape"],

    // Platform-specific settings:
    "osx" : {
        // See README or third-party documentation
    },

    "windows" : {
        // See README or third-party documentation
    },

    "linux" : {
        // See README or third-party documentation
    }
},

另外,请记住在尝试再次构建之前删除所有辅助文件。

答案2

我遇到了类似的问题,但这些构建器设置最终对我有用:

   "builder": "default",  
   "builder_settings" : { 

    // General settings:
    // See README or third-party documentation

    // (built-ins): true shows the log of each command in the output panel
    "display_log" : false,
    "program": "pdflatex",
    "command": ["latexmk", "-cd", "-e", "$pdflatex = '%E -shell-escape -interaction=nonstopmode -synctex=1 %S %O'", "-f", "-pdf"],  

    // Platform-specific settings:
    "osx" : {
        // See README or third-party documentation
    },

    "windows" : {
        // See README or third-party documentation
    },

    "linux" : {
        // See README or third-party documentation
    }
},

我的问题是 Sublime 本身。我必须安装一个名为 Fix My Path 的包,这样 Sublime 才能正确使用 $PATH 变量,并且 Inkscape 才能被识别。

相关内容