I require use of the minted package of similar one which support Prolog syntax-highlighting.

Given that I use the TeXworks "IDE", how do I enable shell-escape?


Though I attempted—see above—I still receive this in my output:

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.
  • Just found this answer… is there a similar line I add for -shell-escape? – A T Nov 14 '12 at 11:20
  • 4
    You should move --shell-escape before $fullname (just select the line and use the green arrows). – egreg Nov 14 '12 at 11:28
  • 1
    Note the two dashes in the argument (as per egreg's comment) for MiKTeX. – cyberSingularity Nov 14 '12 at 11:47
  • what is shell-scape for? – skan Nov 27 '16 at 16:21
  • For running external programs. Escapes to the shell. tex.stackexchange.com/a/88741 – A T Nov 30 '16 at 3:35

I have defined a new tool called pdflatex+shellescape:

enter image description here

And this is the console output if I run it on a file:

enter image description here

The log shows that the --shell-escape option has been activated. With MiKTeX you can call it --enable-write18, but since it understands also --shell-escape it's better to stick with the more general one.

  • Thanks; also I noticed after doing this it became impossible to compile the .tex file when it had spaces... – A T Nov 15 '12 at 5:05
  • 1
    @AT I don't know in Windows, but on Unix systems "$fullname" should work. In any case, better not using spaces in TeX file names. – egreg Nov 15 '12 at 7:29
  • 2
    If you use TeXworks on Windows, you might want to pass --tex-option=--shell-escape instead of just --shell-escape. Otherwise, you will get a cryptic error message: Sorry, but "MiKTeX Compiler Driver" did not succeed. – GuiTeK Aug 23 '18 at 14:54
  • @GuiTeK Sorry, but I've never used Windows in all my life. – egreg Aug 23 '18 at 15:06

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.