How do I syntax highlight a code block in PyLaTeX?

TDavid Source

Just like one can do it using minted package.

\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{document}
pythonpython-3.xlatexpylatex

Answers

comments powered by Disqus