TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

this is my style defined for C#:

  ,lineskip={-1.5pt} % single line spacing

The problem is that for some reason, when the embedded strings are rendered, they look like this:


but should:


I would appreciate any help.

share|improve this question
up vote 3 down vote accepted

The tell-tale hint is the presence of multiple semicolons just before each "token" (syntactic unit of characters) involved in the string.

If you inspect your source code, you'll find the line stringstyle=\color{BrickRed};, which is telling lstlisting to add a semicolon and switch the color to BrickRed each time a token inside a string is typeset. Get rid of the semi-colon and the problem should be fixed.

share|improve this answer
How could I miss that, thanks! – JanuszL Oct 6 '11 at 16:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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