41

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?

preferences

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

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

1 Answer 1

37

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.

6
  • Thanks; also I noticed after doing this it became impossible to compile the .tex file when it had spaces...
    – A T
    Commented Nov 15, 2012 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
    Commented Nov 15, 2012 at 7:29
  • 5
    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
    Commented Aug 23, 2018 at 14:54
  • 1
    @GuiTeK Sorry, but I've never used Windows in all my life.
    – egreg
    Commented Aug 23, 2018 at 15:06
  • 1
    @AaronJPung The idea is that one wants to know precisely when running with -shell-escape active and not always.
    – egreg
    Commented Jul 25, 2022 at 19:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .