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 trying to display matlab code in a LaTeX document and the comments are typeset with an ugly space between letters:

\documentclass{article}

\usepackage{listings}
\lstset{language=Matlab}
\lstset{tabsize=2}

\begin{document}
\begin{lstlisting}
function gramschmidt(A) %The columns of A are the initial basis to the subspace
\end{lstlisting}
\end{document}

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 might want to use the matlab-prettifier package; see this answer. –  Jubobs Apr 28 at 15:21

1 Answer 1

up vote 12 down vote accepted

It looks better with

\lstset{flexiblecolumns=true}

alt text

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

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.