Show only leading spaces of a line?

Is there a way to show only leading spaces of a string? I was looking for a guide to lstlisting, but it does not seem to support this feature. I use a code type, using lstlisting with "showpaces" enabled, it shows all the spaces in the code that confused my eyes (and probably others, I think). Since the code is a layout, I want to show only the spaces of each line to give an idea of ​​what the layout means to the reader. Does anyone know a job? Thank.

+3
source share
1 answer

I can't find a solution ... Ugly ugly ugly ugly workaround:

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

and use \sspace instead in your code.

Do not go down. I will delete if something works out. :-)

+2

Source: https://habr.com/ru/post/1751958/


All Articles