TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to display matlab code in a LaTeX document and the comments are typeset with an ugly space between letters:



function gramschmidt(A) %The columns of A are the initial basis to the subspace

results in alt text

Is there a way to improve the kerning (or whatever its called) of the text in the comments?

share|improve this question
You may be interested in the matlab-prettifier package; see this answer. – Jubobs Nov 14 '14 at 8:45
up vote 12 down vote accepted

It looks better with


alt text

share|improve this answer
perfect, thanks. – Yossi Farjoun Dec 14 '10 at 13:42

Your Answer


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.