1

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:

\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=\color{red},
        frame=b,         
%        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 ?
        xleftmargin=17pt,
        framexleftmargin=17pt,
        framexrightmargin=5pt,
        framexbottommargin=4pt,
        %backgroundcolor=\color{lightgray},
        showstringspaces=false,      % Leerzeichen in Strings anzeigen ?  
        inputencoding=utf8,
          literate={å}{{\aa}}1
                        {æ}{{\ae}}1
                         {ø}{{\o}}1      
}

\lstloadlanguages{% Check Dokumentation for further languages ...
        %[Visual]Basic
        %Pascal
        C,
        %C++
        %XML
        %HTML
        Java
}
\DeclareCaptionFont{white}{\color{white}}
\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}}
Werner
  • 603,163
JavaCake
  • 481

1 Answers1

2

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.

Werner
  • 603,163