How to invoke LaTeX with the shell-escape flag?
Modify the recipe accordingly, see here. If you want to keep using latexmk, have a look at latexmk's manual: the --shell-escape option can only be added as an option to -[pdf]latex. From the latexmk manual
latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" foo.tex
@jlelong The link to the readme section is broken. Here's the new one.
Most helpful comment
Modify the recipe accordingly, see here. If you want to keep using
latexmk, have a look atlatexmk's manual: the--shell-escapeoption can only be added as an option to-[pdf]latex. From thelatexmkmanual