I am working on a .tex file inside Visual Studio Code with the Latex Workshop extension installed. I get following error message when I want Latex to compile .svg files for me, following this post
You didn't enable `shell escape' (or `write18')
I tried to add '–shell-escape', '-shell-escape', '-enable-write18' to the arguments that are passed to the pdflatex tool in my settings.json with no effect…
"latex-workshop.latex.tools": [
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%",
"--shell-escape"
],
"env": {}
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
],
"env": {}
}
]
Best Answer
I got it working by modifying latexmk task which seems to be invoked by default (auto-update on file edit).
See the LaTeX Workshop extension FAQ for more info.
settings.json
(e.g.cmd/ctrl + shift + P
, typePreferences: Open Settings (JSON)
in the command box)latex-workshop.latex.tools
. If it's not visible, start typing it as a new entry and VSCode will unhide it."-shell-escape",
to the args.Example: