I think, the core of the question is: Should I use
- (a) the macros provided by the
minted library of
- (b) the base
tcolorbox package without the
minted library but with the macros from the
The answer will depend on your special application and will also be opinion-based to a certain degree, but I will try to give the pros and cons.
(a) Using the
minted library of
- Pro: The library provides shortcut macros which allow to write a compact source code. The option settings for
minted are melted into the
tcolorbox options which allows common settings (you may call that clean). New boxed listings (numbered or not) are created easily by the environment creation macros of the library. There is special support, if the minted code is a LaTeX source which should be also be displayed compiled.
- Con: The library macros enwraps the
minted macros which may hide some (future) functionality of
minted. The box content is filled automatically; individual mixtures of e.g. source+text+source are not covered.
(b) Using the base
tcolorbox plus macros from the
Pro: Full flexibility for the box content. All (future)
minted capabilities can be used directly.
Con: Longer and more complex source code. Option settings for
minted have to be done separately.
Why was the
listings library created? Because I had tons of examples using the (b) method which all had the same ever-repeating structure. With the library, they are much shorter and better readable. But, my examples mostly contained source code plus compiled text; there, the advantage is greater than just displaying source code.
Finally: There is no need to use either (a) or (b). Both can be used in parallel. I use the (a) method for most cases. If a box needs more flexibility (e.g. two source codes in one box), I switch to (b) for this box.