Minted is a great package for latex users to insert colorful code in the manuscript. But enabling minted in latex might not as easy as other packages. Here are some tips to save your time.

Installation & Configuration

Note: This guide is based on MacTex.

Import package

Import the minted package:


Add –shell-escape option

Make sure you are adding the --shell-escape option while building.

For example, if you are using the VS Code with latex-workshop, you have to add the --shell-escape option in the setting:

"": [
        "args": [
        "command": "pdflatex",
        "name": "pdflatex"

Install pygments

If you see the error “You must have `pygmentize’ installed to use this package”. You have to install the pygments.

For mac user:

brew install pygments


LaTeXTools can’t find installed pygmentize package