LaTeX and minted errors



I had the same problem. I think those spurious k+kn and n+n bits in the code are the color codes for pygmentize, but somehow the \PY latex command wasn't defined (or something) so they just came out as text.

In any case, I tried updating python-pygments, pygmentize, several texlive packages, but nothing worked until I updated my copy of minted.sty (I just got it from the GitHub page ( … minted.sty) and moved it to /usr/share/texmf-dist/tex/latex/minted/minted.sty, which is where my original copy was). Everything worked well with the new version of minted.sty. No need for initial spaces or anything.