17

I was setting up a nice environment to present my code in printed documentations. First I was using the lstlisting package for Latex but then I stumbled upon minted.

minted is really great, but is there a way to change the highlight colors?

Since minted uses the Pygments library, I assume Pygments is the key to the color, but I haven't found it yet.

Could anyone explain how it can be done or post a link that shows how it's done?

minted highlighted output

Maaalte
  • 6,011
  • 3
  • 29
  • 27

1 Answers1

19

You want

\usemintedstyle{<name>}

where you can get <name> by doing

pygmentize -L styles

at the command prompt/terminal. For example, the minted documentation itself uses the trac style.

Joseph Wright
  • 2,857
  • 22
  • 32
  • 1
    Great. I found some nice styles, but I think I will try to customize them a litte (as shows here http://pygments.org/docs/styles). Thank you! – Maaalte Feb 01 '11 at 21:27
  • To try out pygments, the [pygments demo website](https://pygments.org/demo/) can be used. – SebastianWilke Oct 24 '22 at 20:03