In my file, I use the package minted that requires to use the option -shell-escape to be passed towards the processor (in this case pdflatex). In order to use this option with emacs and AUCTeX, I needed to add the following line into my LaTeX-file: %%% TeX-command-extra-options: "-shell-escape" in the block local variables. So the end of my file looks like this:

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-engine: pdflatex
%%% TeX-master: t
%%% TeX-command-extra-options: "-shell-escape"
%%% End:

Every time I load that file into emacs, emacs asks me if I want to use this option, as emacs considers it "unsafe". I said yes.

However, I have an issue when I'm compiling my LaTeX-file (with package mintedincluded). The log file says that

Package minted Error: You must invoke LaTeX with the -shell-escape flag.

Beyond that, I have the following error:

Package minted Error: You must have `pygmentize' installed to use this package.

But I don't understand why since when I open an shell and I enter the following command:

`pdflatex -shell-escape myfile.tex`

then the file is compiling.

Moreover, I edited this file last week and I didn't have this problem with pygmentize. Since I have started to use prelude yesterday, the problem is related to that.

So how can I resolve these two problems?

closed as unclear what you're asking by TeXnician, Troy, Mensch, Bobyandbob, Torbjørn T. Dec 30 '17 at 18:15

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • You might want to ask on the auctex mailing list instead. – daleif Feb 3 '15 at 9:57
  • Does your AucTeX PATH contains the path where pygmentize is located? – Romain Picot Sep 4 '15 at 19:09
  • I am running Aquamacs, AUCTeX and TeXLive on a recent MacOS. I tried the first code example on page 7 from ftp.fau.de/ctan/macros/latex/contrib/minted/minted.pdf with the given Local Variables section. Emacs asks to use the unsave option, I answer yes and start (in my case) lualatex. Everything went smooth. This is the beginning of my log file: Running LaTeX' on fptest' with ``lualatex --jobname=test -shell-escape --synctex=1 -interaction=nonstopmode "\input" test.tex'' This is LuaTeX, Version 0.95.0 (TeX Live 2016) – Jan Dec 27 '16 at 10:36
  • Which emacs version do you use? – Jan Dec 27 '16 at 10:37