6

Consider the following minimal example:

\documentclass{standalone}
\usepackage{listings}
\begin{document}
\begin{lstlisting}[keywordstyle = \textbf, language = SQL, deletekeywords = {time}]
create table Event (id integer primary key, time date);
\end{lstlisting}
\end{document}

This prints ‘time’ in boldface, using the listings package revision 15878 (1.4), TeX Live 2012. How can I make Listings ignore the ‘time’ keyword?

1 Answer 1

10

it is defined as an end keyword and can be deleted only with the (deprecated) deletendkeywords. Looks like a bug to me. However, you have to use the uppercase version of the keyword as it is defined in the language file.:

\documentclass{article}
\usepackage{listings}
\begin{document}
\begin{lstlisting}[keywordstyle=\textbf, language=SQL, deletendkeywords={TIME}]
create table Event (id integer primary key, time date);
\end{lstlisting}
\end{document}

enter image description here

2
  • 1
    This was also true of the Python keyword filter; I had to use deletendkeywords={filter}.
    – tbekolay
    Sep 25, 2013 at 15:50
  • Ditto for Python keyword list.
    – Norswap
    Jan 28, 2019 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .