The documentation of Pygments on creating your own style is not entirely complete (at least, I had to perform some steps that were not discussed and a comment suggests them too). So I'll discuss what extra steps are necessary (in my experience) and my own implementation of a style with my University's color scheme.

First of all, locate the Pygments style folder. I don't know any more how I installed Pygments, but mine is located at /usr/local/lib/python2.6/dist-packages/Pygments-1.3.1-py2.6.egg/pygments/styles. You could also perform a locate command as that should be one of the default styles. My Sage install also contains this folder, but you don't need that one.

Now copy one of the styles and start editing it (this part is explained in Pygments' documentation). For instance, I created this first draft of a style file:


    A style based on the University of Antwerp's color scheme

from import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
     Number, Operator, Whitespace

class UAStyle(Style):
    default_style = ""

    # the three main colours, as per Nico Schlömer's
    # great UniversiteitAntwerpenTheme for beamer
    uablue = '#003d64'
    uared = '#7e002f'
    vividbrown = '#d79a46'
    green = '#007e11'

    styles = {
        Whitespace:                 '#bbbbbb',

        Comment:                    '#aaaaaa',
        Comment.Preproc:            '#4c8317',
        Comment.Special:            'italic ' + uablue,

        Keyword:                    green,
        Keyword.Type:               '#00aaaa',

        Operator.Word:              green,

        Name.Builtin:               green,
        Name.Function:              uablue,
        Name.Class:                 'underline ' + vividbrown,
        Name.Namespace:             'underline ' + uablue,
        Name.Variable:              green,
        Name.Constant:              uared,
        Name.Entity:                'bold ' + uablue,
        Name.Attribute:             '#1e90ff',
        Name.Tag:                   'bold ' + uared,
        Name.Decorator:             '#888888',

        String:                     uared,
        String.Symbol:              uablue,
        String.Regex:               '#009999',

        Number:                     '#222222',

        Error:                      '#F00 bg:#FAA'

As you can see I made the colours consistent with the colours used in Nico Schlömer's beamer theme.

This file must be saved in the aforementioned styles directory. Now edit, where the dictionary STYLES_MAP should contain a line 'ua': 'ua::UAStyle',. Although the documentation (and code, on a quick inspection) suggests it should be able to find styles automatically, it doesn't, as is proved by this LaTeX error:

! Undefined control sequence.
               {n}{P}\PY {o}{.} \P...
l.2 ...\PY{n}{QQ}\PY{p}{,} \PY{l+m+mi}{2}\PY{p}{)}

In case you're writing your own style, the key in the dictionary is the name used in your LaTeX document (so mine reads \usemintedstyle{ua}) while the part in front of :: is the filename and the part behind it the Python file your style is located in.

All information is available at, including installation information. The previous should be considered obsolete.

Now running pdflatex on your document that uses the minted package should provide you with your customized colour scheme.

I'm not yet entirely happy with how the theme comes out at the moment: not enough contrast and only three colours. I should find a matching green and use it too, but for now this post can be used as a starter for anyone interested (I suspect the collaborator for my Bachelor theses will enjoy this write-up) in getting his code in our University's colour scheme :).