I am trying hard to create an environment for my source code. Here's my current state


\newminted{python3}{bgcolor=bg, tabsize=4}







I get fancyVerbErrors. I am lost. Any help would be very appreciated

  • 1
    Please post a complete example that we can run to get the errors, a fragment is not so useful, Commented Jan 26, 2016 at 12:43

1 Answer 1


This should do what you want.


You need \VerbatimEnvironment, because you are creating an environment that uses fancyvrb internally. You need a % after \begin{python3code} to prevent the newline that follows it from being treated as a space and triggering a fancyvrb error.

  • @tschm I just added a note on this to the documentation for the next version of minted, so it should be easier to find in the future.
    – G. Poore
    Commented Jan 26, 2016 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .