[texhax] listings' alignment function

Neal H. Walfield neal at walfield.org
Thu Jan 12 10:46:04 CET 2012


At Thu, 12 Jan 2012 10:19:13 +0100,
Lars Madsen wrote:
> Please provide a minimal example

I'm sorry, I should have included this from the outset.  The key
missing detail is that I'm using fullflexible columns.  The alignment
is correct for flexible columns.  Here's a minimal example that
demonstrates the problem:

\documentclass{book}

\usepackage{listings}
\lstset{
  columns=fullflexible,
  showstringspaces=false,
}

\begin{document}

\begin{lstlisting}
for (s = list;
     s;
     s = g_slist_next (s))
\end{lstlisting}

\end{document}

> note in your example there are too many spaces in front of some of the 
> line in order for them to align on the s's

I'm not sure what you mean here.  I checked my original email and all
of the s's are aligned in my example's input.


Thanks for your help.

Neal


More information about the texhax mailing list