When using babel 'frenchb' with xelatex, spaces are introduced before colons and other characters. This is great for prose, but this is also being applied to code snippets. This yields an unacceptable result when rendering code as a monospaced font.
The image below is supposed to read "a:b:c" but the colons are hidden under other letters because of the extra spacing:
It was generated with this code:
\documentclass{report}
\usepackage{listings}
\usepackage[frenchb]{babel}
\lstset{basicstyle=\ttfamily, columns=fixed}
\begin{document}
\begin{lstlisting}
a:b:c
\end{lstlisting}
\end{document}
I'm not sure how I should remedy this. I've already tried using other fonts to no avail, and setting columns=flexible has the effect of wrecking the vertical alignment because of the extra spaces.
fontspecand compiling withpdflatex, it works fine. – T. Verron Jun 05 '13 at 15:02xelatex, the problem appears even withoutfontspec. So you can remove it from your MWE, and mention that you are usingxelatexinstead. – T. Verron Jun 05 '13 at 15:16