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?

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

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

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.