Finding `pygmentize` installation for `minted`
This article concerns the
macOS
app.

Successful use of package minted requires installation of a tool called Pygments; see apps/typesetting/typesetters/external/minted . Pygments provides a binary called pygmentize whose location depends on the method of installing Pygments.

Ensuring pygmentize availability to Texifier

Texifier sources the user’s Shell profile in order to ensure that pygmentize and other tools can be found. As long as the path to pygmentize is set up in your bash or other Shell profile properly, Texifier will be able to find it when typesetting a document that uses the minted package. You can determine this path by running which pygmentize on the command line in the Terminal app.

To explain this further, let’s assume that pygmentize is installed using Homebrew which installs its binaries in /opt/homebrew/bin and we get,

[~]$ which pygmentize
/opt/homebrew/bin/pygmentize

Homebrew will set the path up for you, but if it didn’t and let’s say that we used Bash) as our Shell on macOS, we would need to update our ~/.bash_profile with this line:

export PATH="/opt/homebrew/bin:$PATH"

to ensure pygmentize can be seen by other tools and command which pygmentize produces the correct path to pygmentize.

Troubleshooting

Setting the Correct Shell within Texifier

Please ensure that a valid Shell has been selected in the settings as shown in the “Process Environment” section of the “External Typesetter” settings below

docs/apps/typesetting/settings/external-typesetter_macos.png

To find out which Shell you’re using, you can run the following command in the Terminal app,

echo $SHELL

The Shell you choose must be set up with pygmentize (as well as other external typeset tools you may use).

Correctly Setting up the ZSH Environment

If you’re using ZSH as your shell and setting environment variables, please note that you may have to define them (and export them) in your ~/.zshenv file instead of in the ~/.zshrc file.