Search code examples
latexlistings

Latex listings package deletekeywords option not working


I'm using listings package in Latex to insert Pascal code in a document. I would like Read not being a keyword, so I used deletekeywords parameter, like this:

\lstset{
        language=pascal,
        basicstyle=\ttfamily\footnotesize,
        showspaces=false,
        showstringspaces=false,
        backgroundcolor=\color{grisclaro},
        keywordstyle=\bf,
        commentstyle=\color{gray},
        stringstyle=\color{orange},
        breaklines=true,
        deletekeywords={Read},
        morekeywords={String,unit,uses,class,private,public}
        }

But Read is still appearing in bold like the other keywords. What am I doing wrong?


Solution

  • Even though Pascal is not case-sensitive (and so is the parsing step when parsing your listing), TeX/listings is not. The keyword was defined as read, not Read, so you must remove it with

    deletekeywords={read}