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

How can I fix this issue with everything inside and including the "quotation mark" itself becomes white, in my case invisible due to the white background.

Thanks in advance.

I almost forgot that im using following \lstset:

        basicstyle=\footnotesize\ttfamily, % Standardschrift
        %numbers=left,               % Ort der Zeilennummern
        numberstyle=\tiny,          % Stil der Zeilennummern
        %stepnumber=2,               % Abstand zwischen den Zeilennummern
        numbersep=5pt,              % Abstand der Nummern zum Text
        tabsize=2,                  % Groesse von Tabs
        extendedchars=true,         %
        breaklines=true,            % Zeilen werden Umgebrochen
%        keywordstyle=[1]\textbf,    % Stil der Keywords
%        keywordstyle=[2]\textbf,    %
%        keywordstyle=[3]\textbf,    %
%        keywordstyle=[4]\textbf,   \sqrt{\sqrt{}} %
        stringstyle=\color{white}\ttfamily, % Farbe der String
        showspaces=false,           % Leerzeichen anzeigen ?
        showtabs=false,             % Tabs anzeigen ?
        showstringspaces=false,      % Leerzeichen in Strings anzeigen ?  

\lstloadlanguages{% Check Dokumentation for further languages ...
\DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}}
share|improve this question
Please, add a minimal example of code – egreg May 27 '12 at 21:21
Here you’ll find more information about minimal working examples (MWE). – Tobi May 27 '12 at 21:40
There's a missing comma after showstringspaces=false. However also an example of the failing code is necessary. – egreg May 27 '12 at 22:30
@egreg, thanks for noticing that typo, i have corrected it. I will look into minimal working example. – JavaCake May 27 '12 at 22:32
Related post: Colored strings by listings package – Werner May 27 '12 at 22:40
up vote 2 down vote accepted

The obvious problem here is that you're setting your strings to be \color{white}\ttfamily, and strings are initiated in a listing via single or double quotes, depending on the language. If you want your strings to show, use \color{black}\ttfamily (or another colour other than white).

The listings documentation contains some minimal examples that illustrate the default behaviour of typesetting strings (for example, the inclusion of a squat-U - or \textvisiblespace - as a visible space character). As such, you modify string-specific behaviour. See Strings (p 44) of 4.18 Language Definitions.

share|improve this answer

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.