[Tex/LaTex] How to have latexmk always use -shell-escape

latexmkshell-escape

I haven't seen this asked specifically, though I have seen related questions.

I just installed the minted package and noticed I have to run latex/pdflatex with a command-line option, -shell-escape, for it to run. I can do that manually, of course, but what if I'm using latexmk?

Best Answer

You can pass the parameter directly to latexmk as such:

latexmk -shell-escape

This option is not mentioned in the manpage. The manpage suggests the -e option which is also used in the first answer. This option amongst many others can be found using

latexmk -showextraoptions

The command output starts with the following note:

List of extra latex and pdflatex options recognized by latexmk. These are passed as is to (pdf)latex. They may not be recognized by particular versions of (pdf)latex. [..]

Tested with latexmk versions

  • 1 January 2015. Version 4.41
  • 26 Dec. 2019, version: 4.67