0

I have the following sample of code.

\begin{lstlisting}[
       language=SQL,
       showspaces=false,
       basicstyle=\ttfamily,
       numbers=left,
       numberstyle=\tiny,
       commentstyle=\color{gray},
       keywords={}
    ]
SELECT * FROM date;
\end{lstlisting}

Even though I have removed all keywords using keywords={}, date is still being highlighted as a keyword.

Any idea why?

5
  • Hi and welcome. Do you need deletekeywords?
    – Symbol 1
    May 20 '20 at 19:47
  • I have tried deletekeywords={date}, though it still has no effect
    – ICTOAUN
    May 20 '20 at 20:36
  • Try this: keywords={},keywords={[2]{}} May 20 '20 at 20:48
  • thank you! keywords={[2]{}} works
    – ICTOAUN
    May 20 '20 at 20:50
  • @hair-splitter Can you elaborate the solution? :) May 21 '20 at 7:37
1

keywords={} delete (more exactly redefine) the all keywords from keyword list 1. The DATE keyword is in the keyword list 2. So you should delete the all keywords from keyword list 2 with keywords={[2]} or keywords={[2]{}}. If you want to delete only DATE keyword, then use deletekeywords={[2]DATE}.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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