我正在使用该listings
包进行语法突出显示,并使用以下参数进行设置:
\lstset{
language=Java,
captionpos=b,
tabsize=3,
frame=lines,
numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
basicstyle=\footnotesize,
identifierstyle=\color{magenta},
keywordstyle=\bfseries,
commentstyle=\color{darkgreen},
stringstyle=\color{red}
}
这工作得很好,导致:
我想要的是常量MIN_PIXELS
和MAX_PROCESSING_TIME
以不同的颜色设置样式,并且类名Rectangle
,Bitmap
等以另一种颜色设置样式。如果我能把数字涂上颜色也很好,但这不是我的主要关注点。
有没有办法做到这一点?