3

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:

\documentclass{article}
\usepackage{minted}
\setminted{style=lovelace,fontsize=\small}
\begin{document}
\section{A section}
Here we go. 
\begin{minted}{python}
def fact(n):
    if n == 0 or n == 1:
        return 1
    return n * fact(n-1)
\end{minted}
\end{document}

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:

\AtBeginDocument{\minted@checkstyle{}\setminted{style=default}}
2
  • 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

2

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.