I'm using minted to format code in a book. Except for the bw theme, I only see colored styles, which is nice for producing a PDF, but not ideal for printing in black & white.

Is there a clean black & white style I can use (probably something resembling what algorithmicx produces) for pygments/minted which I could use for the printable version of the book?

  • 1
    You can try \usepackage[gray]{xcolor} – Marco Daniel May 29 '12 at 16:00
  • That works @MarcoDaniel, but it doesn't make text bold like algorithmicx does. – ℝaphink May 29 '12 at 18:31
  • The gray option prevents other colors to appear. Especially, when highlighting some text (like when using the changes package). Using ulem instead of colors might not be the best choice: tex.stackexchange.com/questions/270901/…. I really like the friendly style and would love to see it converted to a grayscale style. – koppor Oct 4 '15 at 9:54

Marco's solution is probably the nicest one:


The reason I was not getting bold text was that I only loaded Inconsolata and not Inconsolata Bold. I now set up my mono font like this:

\setmonofont[Scale=0.9,BoldFont={Inconsolata Bold}]{Inconsolata}

and the result is fine (using the default style):

black and white code listing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.