14

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?

lockstep
  • 250,273
Yossi Farjoun
  • 13,274
  • 10
  • 74
  • 96

1 Answers1

14

It looks better with

\lstset{flexiblecolumns=true}

alt text

Stefan Kottwitz
  • 231,401