[Tex/LaTex] Global settings for minted

minted

I'm working on a document where source code listings are largely in a single language, and where I would like to have a homogeneous listing style document-wide. Using an example from the docs, I would essentially like to make the following settings globally effective across my document:

\begin{minted}
[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
linenos
]
% ... contents of code listing ...

Does the minted package offer a way to apply these options globally?

Best Answer

Yes, there is the\setminted command for setting options for the whole document. From the package documentation:

You may wish to set options for the document as a whole, or for an entire language. This is possible via \setminted[<language>]{<key=value,...>}. Language-specific options override document-wide options. Individual command and environment options override language-specific options.

Setting options only for inline commands can be done via \setmintedinline.