0

I have been using VS Code + Latex Workshop for the last year and so to write up my tex documents however today I tried using the minted package which I have installed in /usr/local/bin/pygmentize

In my preamble I have used the line \usepackage{minted} and when I try to produce my pdf I get this error in my .log file:

Package minted Error: You must have `pygmentize' installed 
to use this package.

How do I fix this?

  • you need to install pygmentize in your operating system (it is a python package) you say you installed minted in the pygmentize directory, which would not be right, also you need to use latex with --shell-escape – David Carlisle May 19 '18 at 22:51
  • Requirement already satisfied: Pygments in /Library/Python/2.7/site-packages/Pygments-2.2.0-py2.7.egg (2.2.0) This is what I get after installing , is it in the wrong location? – bigfocalchord May 19 '18 at 23:05
  • you need pygmentize to be on the path so typing pygmentize in the terminal works, I guess that's a mac and I can't help with the details on macos, sorry – David Carlisle May 19 '18 at 23:43
2

You could try @David Carlisle's comment by adding --shell-escape to the compiling commands in the preference of LaTeX Workshop, like the following:

// in USER SETTINGS add the following
"latex-workshop.latex.tools": [
    {
        "name": "latexmk",
        "command": "latexmk",
        "args": [
            "--shell-escape", // added arg to default
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "-pdf",
            "%DOC%"
        ]
    },
    {
        "name": "pdflatex",
        "command": "pdflatex",
        "args": [
            "--shell-escape", // added arg to default
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOC%"
        ]
    },
    {
        "name": "bibtex",
        "command": "bibtex",
        "args": [
            "%DOCFILE%"
        ]
    }
]

This worked for me with VS Code 1.24.1 and LaTeX Workshop 5.5.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.