I have just upgraded mi MacTeX installation to MacTeX 2016 (from '2015 with all packages updated) and I found that changing the default style using \setminted{style=...} in the document preamble does not longer work; now I have to include the \setminted command after \begin{document}.

For example, in this document the font size is changed, but the style is not:

\section{A section}
Here we go. 
def fact(n):
    if n == 0 or n == 1:
        return 1
    return n * fact(n-1)

However, if I move the \setminted command after \begin{document}, then the style is correctly changed.

TeX Live 2016 includes minted v2.2. The previous version v2.1 did not show this problem. I think that the cause resides in this line in minted.sty v2.2 and not present in v2.1:

  • you are probably best to ping the author here github.com/gpoore/minted/issues Jun 17, 2016 at 14:36
  • 1
    This is a bug that resulted from working on another bug. Unfortunately the initial style setup is getting a bit complicated due to the possibility of users setting a custom pygmentize in the preamble. Working on a fix.
    – G. Poore
    Jun 17, 2016 at 22:14

1 Answer 1


The bug is fixed in minted v2.2.2, which is currently on GitHub and will be on CTAN soon.

You must log in to answer this question.