So I've been loosing my mind over typesetting a document with some code examples. After a few days of investigations I was able to narrow down the issue.
This is the preamble (edit: shorter code):
\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{tocloft}
\usepackage[most,listings,minted]{tcolorbox}
\usepackage[english]{babel}
\newtcblisting[auto counter,number within=chapter,list inside=loe]{cxmpl}[2]{listing engine=minted,minted language=#1,minted options={breaklines,autogobble,linenos,fontsize=\small,numbersep=3mm},title=\textbf{Code~\thetcbcounter:} #2}
\newtcbtheorem[use counter from=cxmpl,list inside=loe]{xmpl}{Example}{}{xmp}
\begin{document}
\chapter{One}
\begin{minted}{csharp}
int main() {printf("hello, world");return 0;}
\end{minted}
\begin{cxmpl}{csharp}{A different code}
int main() {printf("hello, northpole");return 0;}
\end{cxmpl}
\begin{xmpl}{An example}
this is just an example
\end{xmpl}
\begin{minted}{csharp}
int main() {printf("hello, sun");return 0;}
\end{minted}
\begin{cxmpl}{csharp}{Some different code}
int main() {printf("hello, woods");return 0;}
\end{cxmpl}
\end{document}
produces the following output (without errors):
In 1.2 the "t" is missing and 1.1 and 1.3 shows not the right code.
Typesetting the same code without the minted environment produces this output:
Typesetting after deleting all the files and folders produces the following errors and output:
The strange thing is, that the console shows this message for every cxmpl-environment. However they don't show up in the log:
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
Error: cannot read infile: [Errno 2] No such file or directory: 'test_pygments.pyg'
For now I'm quite lost, because I cannot explain to myself where the issue could come from.








\documentclassto\end{document}. We don't mind the formatting here, we only want to analyze and get rid of the error. It's much easier when it is isolated. Thanks. – frougon Apr 06 '20 at 09:41mintedworking OK withouttcolorbox? – Tomáš Kruliš Apr 06 '20 at 10:03mintedenvironment, it works fine. The code changes and the coloring is correct – m.dec Apr 06 '20 at 11:07