How can I apply different styles to keywords depending on their prefix?
Here is some sample code:
(-2,0,0) (2,1,1) op-registerbox !box1
;box1 /Blue op-setproperties
I'd like to typeset
- words starting with
!and;in color red, - words starting with
/in color green, - words starting with
cp-in bold.
So far, this is what I've got:
\lstdefinelanguage{XX}
{
basicstyle=\small\sffamily\fontseries{c},
emphstyle=\underbar,
keywordsprefix=[2]{/},
alsoletter={/},
keywordstyle=\textbf,
keywordstyle=[2]\color{green},
morekeywords={op,registerbox, ...},
morestring=[b][\color{green}]",
columns=flexible,
escapechar=\%,
numbersep=6pt,
numberstyle=\scriptsize
}
I'm aware that only one keywordsprefix can be defined at the moment: specifying more than one class of prefix (keywordsprefix=[2]{/}) is currently not supported.
I'd like to avoid having to list all the words that match my description into morekeywords. Is that possible? How?
