1

I am using TeXStudio with LuaLaTeX on Windows 10. When I call \usepackage{minted} I get

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

How can I solve the problem?

Superman
  • 1,615
  • In the Options>Configure TeXstudio, set the command of lualtex to lualatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex for example. – Sigur Apr 13 '20 at 19:03
  • 1
    By adding the -shell-escape flag, does it add more flexibility? Or will it not run for other types of code? – Superman Apr 13 '20 at 19:05
  • @Superman Actually -shell-escape brings risk. See https://www.texdev.net/2009/10/06/what-does-write18-mean/ and https://tex.stackexchange.com/a/20446/79060 . – muzimuzhi Z Apr 13 '20 at 19:15
  • @Superman @muzimuzhi M Despite the risk (relative minor when creating your own .tex files) you will need the --shell-escape command in order to access the Pygments library of Python. Otherwise the use of the minted package is senseless. See the Requirements section of the manual. – alchemist Jan 28 '23 at 13:32
  • @Superman Apparently the path statement is changed using LuaLaTeX under Windows. You can check that using the code \documentclass[11pt]{article} \usesepackage{shellesc} \begin{document} \ShellEscape{path > path.txt} \end{document} Compare the content of path.txt to the actual path in cmd of Windows. – alchemist Mar 03 '23 at 15:17

0 Answers0