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.
A T
  • 4,093

1 Answers1

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.

egreg
  • 1,121,712
  • 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 05: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 07: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 Aug 23 '18 at 14:54
  • 1
    @GuiTeK Sorry, but I've never used Windows in all my life. – egreg Aug 23 '18 at 15:06
  • Instead of making a new compiler, you can just add the --shell-escape command under the -undump-xelatex command right in the XeLaTeX configuration. – AaronJPung Jul 25 '22 at 19:15
  • 1
    @AaronJPung The idea is that one wants to know precisely when running with -shell-escape active and not always. – egreg Jul 25 '22 at 19:28