I'm using the listings
package for syntax highlighting, set up with the following arguments:
\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}
}
This works fairly well, resulting in:
What I would like, is that the constants MIN_PIXELS
and MAX_PROCESSING_TIME
are styled in a different color, and the class names Rectangle
, Bitmap
, etc. are styled in yet another color. It would also be nice if I could get numbers colored, but that's not my main focus.
Is there any way to do this?
Listings only works by keywords, so it is not possible.
Minted uses a python library (Pygments) and can do any kind of highlighting as it is able to understand the code and not just keywords.