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?

13

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.

  • this worked. nice! – mircealungu Sep 15 '16 at 15:11
  • For some reason, for me this setting was only applied after restarting Sublime Text. – merlinND May 1 '19 at 13:00
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.

  • I fixed it! See the edits. – Arthur C May 17 '14 at 21:35
  • This worked for me, but I did get a Log parsing issues. Disregard unless something else is wrong message, any idea why? – Bjørn Kjos-Hanssen Aug 27 '15 at 0:26
  • Can't help you there, sorry. It's been a long time, and I don't have the same environment anymore... – Arthur C Aug 28 '15 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.