This question already has an answer here:

I get that symbol inside quotes in listings environment. It seems to appear only inside quotes.Outside of them it seems that is not happenning the same thing. Why do I have that problem and how can I fix it?

enter image description here

marked as duplicate by jub0bs, user13907, Svend Tveskæg, Andrew Swann, T. Verron Sep 17 '14 at 9:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Please provide a minimum working example – penguinpreferred Sep 17 '14 at 4:23

The listings package shows spaces within strings by default. You can turn it off by calling \lstset{showstringspaces=false} somewhere in the preamble. (If you already use lstset to set other things, then you can just add this attribute to that call.)

See also: Strange character when using listings package http://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Settings

  • Thank you very much! I added it as I have a fairly rich lstset preamble! – Adam Sep 17 '14 at 4:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.