Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
1  
It looks like Latin Modern Mono. It should be the default monospaced font. If it's not and you have it installed and if you can use XeLaTeX/LuaLaTeX you could try adding \usepackage{fontspec}\setmonofont{Latin Modern Mono} in your preamble. –  Silex Dec 6 '12 at 12:34
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Only a partial answer, but I hope you can make it from here:

If you are in the matlab editor you can click on File > Preferences

On the left you will find Fonts

Here you can see which fonts are used by Matlab, my guess is that you want to use the font as used in your editor for the pink part.

In my case the editor uses: Monospace, Plain, 10

And the rest uses: SansSerif, Plain, 10

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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