5

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?

10

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.