[Tex/LaTex] How to produce black and white source code using the minted package

minted

I just started using the minted package, to produce formatted source codes.

I thought the style bw is a black and white style of pygmentize and it just uses italic and bold to format the code (I tried the code below), but I was wrong. Is there any way to produce formatted code which looks good in black and white?

\documentclass{minimal}
\usepackage{minted}

\begin{document}
  \usemintedstyle{bw}
  \inputminted{bash}{sample.sh}
\end{document}

Thanks

Best Answer

The problem isn’t the style – bw is correct and works fine! – but the font. The default monospace font of LaTeX doesn’t support italics and bold.

You need to switch to a different font – e.g. by loading the courier package, or by using XeLaTeX and loading a custom font.