# How do I prevent LaTeX from showing a whitespace following a quote when in an lstlistings environment? [closed]

When I am inside the lstlistings environment, it seems that using a quote such as (') or (") will toggle on the showing of whitespace indicators (small little half rectangles). Am I doing something wrong? Here is my listing definition:

\lstdefinestyle{verbo}{
basicstyle=\scriptsize\ttfamily,
breaklines=true,
breakatwhitespace=true,
tabsize=1,
resetmargins=true,
xleftmargin=0pt,
frame=none,
}


And here is the text that uses it:

\begin{lstlisting}[style=verbo]
- foo
- bar' hello world
\end{lstlisting}


After the bar', all the spaces will printout with an ugly whitespace separator, e.g. between "hello" and "world". Is there a simple switch to disable this? I searched the listings documentation and could not find a way to do it.

Edit: Here a complete Example:

\documentclass[a4paper]{article}
\usepackage{color}
\usepackage[ngerman]{babel}

\usepackage{listings}
\lstset{
language={XML},
basicstyle=\ttfamily,
showspaces=false
}

\begin{document}
\begin{lstlisting}[language=XML]
<test attr="Here should not be any whitespace-sign."/>
\end{lstlisting}
\end{document}


In the string these whitespace-signs occure, but they should not.

-

## migration rejected from stackoverflow.comMar 7 '14 at 11:46

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

## closed as off-topic by Jubobs, Martin Schröder, Jesse, Guido, Svend TveskægMar 7 '14 at 11:46

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

that behaviour cannot be seen with current TeXLive. Create a complete example, which shows your behaviour. –  Herbert Aug 24 '11 at 5:55
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register here, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  doncherry Aug 24 '11 at 8:23
This question appears to be off-topic because it's seems the problem reported by the OP can't be reproduced in up-to-date TeX distributions. –  Jubobs Mar 7 '14 at 10:52

use showstringspaces=false, it is different to showspaces

-

When compiling the following minimal example under TeX Live 2011 (listings 2007/02/22, 1.4), there is no problem:

\documentclass{article}
\usepackage{listings}% http://ctan.org/pkg/listings
\begin{document}
\lstdefinestyle{verbo}{
basicstyle=\scriptsize\ttfamily,
breaklines=true,
breakatwhitespace=true,
tabsize=1,
resetmargins=true,
xleftmargin=0pt,
frame=none
}
\begin{lstlisting}[style=verbo]
- foo
- bar' hello world
\end{lstlisting}
\end{document}


However, considering the one of the first examples in the listings package documentation, this might be a default behaviour:

The option showspaces=false might be of help here, since showspaces=true in the above minimal example yields:

-