In minted's default style, as well as a few others (emacs for instance), comments and other stuff like C preprocessor commands show up in a very un-code-like italic font, as shown in the 2 examples below.

I'm using this environment:


How could I change the font to a more console-like one? I tried playing with the fontfamily or fontseries minted options, but I didn't seem to get anywhere with that (I don't know what values to give to them aside from the ones that minted.pdf states they support, and even those seem to either not do anything or break the code completely).

My configuration is Mac OS X Lion, using Latexian as editor, and latest TexLive from MacPorts - versions shown below.

texlive-latex @23089_0+doc
texlive-bin @2011_3+motif+x11

weird font in comments and preprocessor commands

weird font in comments

  • You should try fontfamily=tt,fontshape=\upshape for upright typewriter font.
    – Werner
    Nov 21, 2011 at 18:29
  • I tried changing my minted definition to \newminted[cpp]{cpp}{fontfamily=tt,fontshape=\upshape,frame=lines,framesep=2mm}, but when compiling this in Latexian, pdftex hangs on 100% cpu while waiting for the .pyg output. If I remove fontshape=\upshape, it doesn't hang but it looks the same.
    – Dan
    Nov 21, 2011 at 21:05
  • Could you include a minimal working example (MWE) with some code that you want to change the formatting of?
    – Werner
    Nov 21, 2011 at 21:16

2 Answers 2


Two things:

  1. the font is “console-like” (that is, monospaced); it just happens to be also italic – which, by the way, is a completely valid formatting style and not that unusual (I usually use such a styling).

  2. The italic formatting for comments is supplied by the Pygments style sheet, which supersedes the general font setting (since it’s more specific). In order to change it, you need to create and register an own stylesheet.

  • Thanks! Yeah, I agree it is indeed monospaced, but personally I find it so much harder to read, probably because of the curliness of that specific font than the italics themselves.
    – Dan
    Apr 1, 2013 at 15:29

You need to set the minted style. For instance add:


just after \usepackage{minted} For a list of styles, try this link

or run

pygmentize -L styles

You must log in to answer this question.

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