\RequirePackage{listings}

\lstdefinelanguage{pseudocode}
{morekeywords={procedure,end,loop,return,to,local,Value,fail,if,for,else},
  morecomment=[s]{(*}{*)},
  morecomment=[s][\sl]{<}{>}
}

\lstset{basicstyle=\scriptsize,columns=fullflexible}
\lstset{frame=none,numbers=none,lineskip=-.7ex}%,aboveskip=-1em,belowskip=-2em}
\lstset{keywordstyle={[2]{\red}},keywordstyle={[3]{\blue}}}
\lstset{keywordstyle={[4]{\green}},keywordstyle={[5]{\magenta}}}
\newcommand{\lstkeycolor}[2]{\ifcase#1\textbf{#1}\or\red{#2}\or\blue{#2}\or\green{#2}\or\magenta{#2}\fi}
\define@key{stexlisting}{id}{\def\sref@id{#1}}
\define@key{stexlisting}{id}{\def\stexlst@id{#1}}
