tags:

views:

22

answers:

1

Is there a way to show only leading spaces of a line? I searched the manual of lstlisting, but it seems it did not support this feature. I am type setting a piece of code, using lstlisting with the "showspaces" enabled, it shows all spaces in the code, which messed my eyes (and probably others I guess). Since the code is layouted, I only want to show the leading spaces of each line to give an impression of what layout means to the reader. Anybody knows a work around? Thanks.

+1  A: 

I can't find any solution either... Ugly ugly ugly workaround:

\newcommand{\s}{\phantom{\ }}

and use \s instead of space in your code.

Don't downvote. I'll delete if something better comes up. :-)

aioobe
aioobe, though it is ugly, I see it could solve the problem, thanks for the reply anyway.
plmday