16

I'm using LatexTools for Sublime 2. I want to add the parameter -shell-escape to the build command, but struggling. The documentation says not to edit 'LaTeX.sublime-build', but to edit 'LaTeXTools.sublime-settings'. I've tried doing this, setting "builder": "script" and the build settings as follows:

"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
    }
},

Which I think is what I need. But now when I try and build something, nothing happens.

Any suggestions on what to do?

penguin
  • 261

2 Answers2

14

What worked for me was adding "options": ["--shell-escape"], to builder_settings. The whole block looks like this for me:

"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
    }
},

Also, remember to delete all the auxiliary files before trying to build again.

sk1ll3r
  • 241
  • 2
  • 2
8

I had similar problems, but these builder-settings eventually worked for me:

   "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
    }
},

My problem was Sublime itself. I had to install a package called Fix My Path so Sublime used the $PATH variable correctly and inkscape could be recognized.

Bart Louwers
  • 103
  • 2
Arthur C
  • 181