I want to put some symbols in green color with lstdefinelanguage in latex, but it seems that symbols are not recognized.
The symbols I need to be colored are =, > and <. Is it possible? How can I do this?
The main file:
\documentclass{article}
\usepackage{graphicx,color}
\usepackage{booktabs}
\usepackage{listings}
\lstdefinelanguage{NeoIDL}{
sensitive = true,
keywords = [1]{module, resource, enum, annotation, for, import, entity, path,
@get, @post, @put, @delete, require, ensure, otherwise, call},
%ndkeywords={int, \char{} },
%ndkeywordstyle=\color{blue}\bfseries,
morekeywords=[2]{>, <, ==},
keywordstyle=[2]\color{green},
numbers=left,
numberstyle=\scriptsize,
stepnumber=1,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frame=top,
comment=[l]{//},
morecomment=[s]{/*}{*/},
commentstyle=\color{purple}\ttfamily,
stringstyle=\color{red}\ttfamily,
morestring=[b]',
morestring=[b]"
}
\begin{document}
\begin{figure}[htb]
\begin{small}
\lstinputlisting[language=NeoIDL,firstnumber=1]{store_pos_servico.neo}
\end{small}
\caption{Service 1}
\end{figure}
\end{document}
The file to be formatted:
module store {
(...)
resource order {
path = "/order/{id}";
@post int postOrder (Order order)
require (call store.getOrder(id) == "NotFound"),
otherwise "InvalidPrecondition"
};
}