[Tex/LaTex] change code font using mcode package

fontslistingsMATLAB

I'm using mcode package to insert into my document matlab code. I would change the default font. what command I should use to get this font?

enter image description here

Best Answer

The mcode.sty file has a "Customize here" section.

Change

\def\lstbasicfont{\fontfamily{pcr}\selectfont}

into

\def\lstbasicfont{\ttfamily}

and you'll get the default fixed width font instead of Courier. Or

\def\lstbasicfont{\fontfamily{lmtt}{\selectfont}}

that will choose the Latin Moder Typewriter font, which has also a boldface variant.

Related Question