I want to use minted package in my tex file. It needs the command-line option --shell-escape to allow external pygmentize program execution. How can I add that option to the tex engine?

My related code snippets are

(add-hook 'LaTeX-mode-hook
        (lambda ()
          (setq TeX-auto-untabify t     ; remove all tabs before saving
                TeX-engine 'xetex       ; use xelatex default
                TeX-show-compilation t) ; display compilation windows
          (TeX-global-PDF-mode t)       ; PDF mode enable, not plain
          (setq TeX-save-query nil)
          (define-key LaTeX-mode-map (kbd "TAB") 'TeX-complete-symbol)))

I tried to add (add-to-list 'tex-compile-commands '("xelatex --shell-escape -interaction nonstopmode -output-directory %o %f" t "%r.pdf")), but that doesn't help.


Add the following line to the list of local variables of the source file:

%%% TeX-command-extra-options: "-shell-escape"

Then you need to do M-x revert-buffer to make it applied.

AUCTeX 12.2: 4.1.3 Options for TeX Processors

How to pass flags to the LaTeX compiler with AUCTeX? - Emacs Stack Exchange

emacs - Adding an option to the PDFLaTeX call from AUCTeX - LaTeX Stack Exchange

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.