8

Is there a way to override default options for the minted environment, rather than having to specify them for each and every snippet of code ?

In other words, is there an equivalent to listings's \lstset command ?

AFAIK the minted package is based on fancyvrb, but I couldn't find anything in there either (I don't really read tex so I only looked at the documentation)

Bonus question: why is there so much blank space (about two blank lines) after a minted listing ?

Gyom
  • 743

2 Answers2

12

\fvset{..} mentioned in the documentation several times ...

  • Indeed, thanks for that. I should have read the manual and not skimmed through the titles. /me feels stupid. – Gyom Dec 31 '10 at 13:19
  • 2
    But not in the main section; it is mentioned only in the source code without any actual examples, so it is not obvious at all. – Andreï V. Kostyrka Nov 07 '16 at 03:36
  • Yes, not obvious at all, unless you spend hours to read the entire thing through. Thanks – Tobia Feb 23 '17 at 18:12
5

Bonus question: why is there so much blank space (about two blank lines) after a minted listing ?

This has already been asked – and answered – on Stack Overflow.

As for minted having presets, besides the obvious \fvset, it doesn’t. The rationale was that you would usually define a language-specific shortcut of the minted commands for each language that you use (which usually shouldn’t be that many anyway), as explained in chapter 6 of the documentation.

(And the fact that the minted doc doesn’t mention \fvset is arguably a documentation bug. Perhaps some day I’ll come round to doing a new release.)

Konrad Rudolph
  • 39,394
  • 22
  • 107
  • 160
  • I couldn't find a reference to \fvset in the documentation either. Why does @Herbert claim that it is mentioned there? (I also cannot get \fvset{} to work.) – Stephen Bosch Sep 21 '13 at 17:54
  • @StephenBosch Probably just an honest mistake. The minted documentation does mention somewhere that it’s built on top of fancyvrb, and its documentation mentions \fvset. – Konrad Rudolph Sep 21 '13 at 18:34