Latex 列表包 deletekeywords 选项不起作用
Latex listings package deletekeywords option not working
我在 Latex 中使用 listings
包在文档中插入 Pascal 代码。我希望 Read 不是关键字,所以我使用了 deletekeywords
参数,如下所示:
\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}
}
但是 Read 仍然像其他关键字一样以粗体显示。我做错了什么?
尽管 Pascal 不区分大小写(解析列表时的解析步骤也是如此),TeX/listings 却不区分大小写。关键字被定义为 read
,而不是 Read
,因此您必须使用
将其删除
deletekeywords={read}
我在 Latex 中使用 listings
包在文档中插入 Pascal 代码。我希望 Read 不是关键字,所以我使用了 deletekeywords
参数,如下所示:
\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}
}
但是 Read 仍然像其他关键字一样以粗体显示。我做错了什么?
尽管 Pascal 不区分大小写(解析列表时的解析步骤也是如此),TeX/listings 却不区分大小写。关键字被定义为 read
,而不是 Read
,因此您必须使用
deletekeywords={read}