I am trying to compile a document with the minted package. I am using VSCode LaTeX workshop and compiling using LuaLaTeX.
When I try to compile I get the following error
Package minted Error: You must have pygmentize installed to use this package.
I have pygments installed. When I run pygmentize -V
in the terminal I get
Pygments version 2.7.3, (c) 2006-2020 by Georg Brandl.
A few other things to note:
- I am using WSL with Ubuntu 20.04
- I am compiling using LuaLaTex but I also tried with pdflatex, still doesn't work
- I've add the shell escape flag to all the places mentioned here
- I've tried using the
[cache=false]
option of the minted package - I found this post here on maybe a similar issue? I am not sure if there is a difference between the pygments package you get when you do
sudo apt-get install python3-pygments
vs what you get when you doconda install pygments
If it would help, below are LaTeX recipes from my settings.json
. Maybe I am missing something there?
{
"latex-workshop.latex.recipes": [
{
"name": "latexmk 🔃",
"tools": [
"latexmk"
]
},
{
"name": "latexmk (latexmkrc)",
"tools": [
"latexmk_rconly"
]
},
{
"name": "latexmk (lualatex)",
"tools": [
"lualatexmk"
]
},
{
"name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "Compile Rnw files",
"tools": [
"rnw2tex",
"latexmk"
]
},
{
"name": "lualatexmk ➞ biber ➞ lualatexmk x 2",
"tools": [
"lualatexmk",
"biber",
"lualatexmk",
"lualatexmk"
]
},
{
"name": "lualatex ➞ biber ➞ lualatex x 2",
"tools": [
"lualatex",
"biber",
"lualatex",
"lualatex"
]
},
{
"name": "lualatex x 2",
"tools": [
"lualatex",
"lualatex"
]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "lualatexmk",
"command": "latexmk",
"args": [
"-shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-lualatex=lualatex -shell-escape %O %S",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "latexmk_rconly",
"command": "latexmk",
"args": [
"%DOC%"
],
"env": {}
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
{
"name": "lualatex",
"command": "lualatex",
"args": [
"-shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
],
"env": {}
},
{
"name": "biber",
"command": "biber",
"args": [
"%DOCFILE%"
],
"env": {}
},
{
"name": "rnw2tex",
"command": "Rscript",
"args": [
"-e",
"knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
],
"env": {}
}
],
sudo apt-get install python3-pygments
it works, but I really wish I understood why, what's the difference? – Nukesub Jan 8 at 2:34