I typeset my listings using listings with a proportional font. This looks good for the lstlisting environment. However, when I use \lstinline|code|, the spacing reverts to variable-width. I would like to use the setting columns=fixed with lstinline. If I \lstset it globally, it is ignored for \lstinline. Is there a way to set \lstinline to use columns=fixed without having to add it to every \lstinline in my source code?
Here is a minimal example:
\documentclass{article}
\usepackage{listings}
\lstset{columns=fixed}
\begin{document}
The code \lstinline|A.someMethodName()| is typeset differently from
\lstinline[columns=fixed]|A.someOtherMethodName()|.
\end{document}
columns=fixedadds to much space between characters, which is ok for code blocks but looks weird for inline code.keepspaces=truedoes exactly what promised: it keeps spaces from disappearing without changing anything else. I used it as option tolstMakeShortInlinethough, not forlstset. – Cephalopod Aug 13 '13 at 13:56