# Remove “space symbol” [duplicate]

I'm trying to write:

LCD_write_String_to_Buffer("Esperando      \nconfiguracion...");


but what I get is:

I get like horizontal square brackets. Is there any way to remove all symbols and leave the space empty between "Esperando" and the "\n"?

I'm using listings with this syntax color:

\lstset{language=C++,
keywordstyle=\color{RedViolet},
stringstyle=\color{blue},
morecomment=[l][\color{Orange}]{\#}
}


## marked as duplicate by Uwe Ziegenhagen, Svend Tveskæg, user13907, Werner spacing StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 5 '15 at 23:55

• Are you using listings or any other package? Provide a minimal complete document illustrating the problem. – Gonzalo Medina Aug 5 '15 at 22:53
• Welcome to TeX.SX! How is this connected to LaTeX? What is LCD_write_String_to_Buffer? – user31729 Aug 5 '15 at 22:53
• I don't think this is TeX-related. Rather looks like Arduino... – Uwe Ziegenhagen Aug 5 '15 at 22:53
• What you're getting there is a space character. This is the expected behaviour in some cases and environments and when using some packages. It can probably be turned off with an option or declaration. However, for us to know the cause - and the solution - we need a lot more information. TeX is pretty broad, there are lots of packages, lots of different uses for it, lots of variables. This why we always like to have an MWE (meta.tex.stackexchange.com/questions/228/…). – Au101 Aug 5 '15 at 22:57
• If you'd provided an MWE, we'd've known you were using listings and we could've got started on your problem straight away. Compiling an MWE may also have allowed you to diagnose and solve the problem yourself. – Au101 Aug 5 '15 at 22:58

Use showstringspaces=false; either globally (for all your listings):

\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{listings}

\lstset{
showstringspaces=false,
language=C++,
keywordstyle=\color{RedViolet},
stringstyle=\color{blue},
morecomment=[l][\color{Orange}]{\#},
}

\begin{document}

\begin{lstlisting}
LCD_write_String_to_Buffer("Esperando      \nconfiguracion...");
\end{lstlisting}

\end{document}


or locally (for a particular one):

\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{listings}

\lstset{
language=C++,
keywordstyle=\color{RedViolet},
stringstyle=\color{blue},
morecomment=[l][\color{Orange}]{\#},
}

\begin{document}

\begin{lstlisting}[showstringspaces=false]
LCD_write_String_to_Buffer("Esperando      \nconfiguracion...");
\end{lstlisting}

\end{document}


The result in both cases:

• that works, but in my case I'm using some syntax color: \lstset{language=C++, keywordstyle=\color{RedViolet}, stringstyle=\color{blue}, commentstyle=\color{ForestGreen}, morecomment=[l][\color{Orange}]{\#} } and in that case it wont work – tulians Aug 5 '15 at 23:04
• @tulians And how do you expect me to guess that? Always provide complete minimal documents in your questions. – Gonzalo Medina Aug 5 '15 at 23:05
• @tulians Please see my updated answer. – Gonzalo Medina Aug 5 '15 at 23:25
• @tulians You're new. Of course we can be patient, it takes time to learn how things are done when you first join a community. But I hope now you realise why we insist on MWEs. Not only could you have got your answer sooner, without needing to explain everything after writing your question; but you also sent Gonzalo Medina on a bit of a wild goose chase - causing him to waste a little of his own, spare time. So hopefully, now you know, next time you won't make a similar mistake :) In the meantime, read the tour tex.stackexchange.com/tour and earn a badge :) – Au101 Aug 5 '15 at 23:34
• @Au101 Such a nice comment. Thanks for writting it. – Gonzalo Medina Aug 5 '15 at 23:43