TransWikia.com

OSX Sierra - Pygmentize sometimes not recognized

TeX - LaTeX Asked on December 18, 2020

I’ve recently decided to switch to minted due to way better Python highlighting. I am having weird issues with minted sometimes not being able to find pygmentize on my Mac – never had the same issues on my windows 10 machine.

Steps I took:

  1. Install local Tex Distribution – check
  2. Install pygments > pip install pygments – check
  3. Check if it’s installed > $pygmentize -h > Usage .../anaconda/bin/pygmentize – check
  4. Adapt Tex document > usepackage[chapter]{minted}
  5. Allow TexStudio to shell escape this document > % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]> then allow it to really use shell escape for this document
  6. Now I am in a weird state – sometimes after starting TexStudio and setting the document I’ll get > Package minted Error: You must havepygmentize’ installed to use this package. begin{document}`. When restarting TexStudio it works fine.

My document consists of one main document that includes the other chapters. Every chapter defines the tex-root like this: %!TEX root = ../doc.tex. The minimal example I’ve tried (which works flawlessly on win and sometimes on mac)

begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
end{minted}

I am grateful for any ideas you might have :).

One Answer

It appear TexStudio is not looking for pygmentize at the right place. So you need to create a symlink :

sudo ln -s "$(which pygmentize)" /Library/TeX/texbin/pygmentize

Answered by UGLi on December 18, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP