2

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 :).

  • This sounds like a PATH problem within TeXStudio. Try to typeset manually in Terminal. – Herb Schulz Jan 8 '18 at 19:20
  • I can only speak for my system after TeXStudio typesetting the document without hiccups again but this works as well - it is kind of a weird issue sometimes. – Faust Jan 9 '18 at 9:05

Your Answer

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

Browse other questions tagged or ask your own question.