While I'm switching from minted to listings, I would like to ask you
for this comparison.
The following is what it comes to my mind till now:
mintedneeds Pygments to work,listingsdoes not (this may be a flaw for beginners but an advantage for expert users)mintedhas averbatimstyle as default, inlistingsit has to be set (How can I make lstlisting look exactly like verbatim?)in
listingsis very easy to add a new keyword, inmintedis not (for beginners, at least, How to add custom C++ keywords to be recognized by Minted?)minted, withsamepageoption, allows to have your code snippets not broken across pages, if you'd like to do the same inlistings, you have to usetcolorbox, or other tricks (Avoid page breaks in \lstlistings)listingsallows to use escape chars within a string,minteddoes not (Minted escapeinside doesn't work within a string).
Eventually, which are the pros and cons of these two packages?
mintedneeds to be run with-shell-escape, depending on the situation this could be a con. – samcarter_is_at_topanswers.xyz Aug 31 '17 at 12:47mintednever really convincing, but that's a personal opinion. – Aug 31 '17 at 14:58minted, is, to quote pygments.org: "a wide range of over 300 languages and other text formats is supported" – Torbjørn T. Aug 31 '17 at 15:04listingsis much more flexible and easy to use, take into account that I don't know anything about Python & Co. – CarLaTeX Aug 31 '17 at 15:05minteddefence, since till now it seems people preferslistings, thank you! – CarLaTeX Aug 31 '17 at 15:08