I am using the following snippet to define a custom language:
\newcommand\mscript{customMATLAB}
\expandafter\expandafter\expandafter\lstdefinelanguage%
\expandafter{\mscript}{
alsoletter={:,=},
morekeywords={find_system,delete_line,...},%
sensitive=t,%
morecomment=[l]//,%
morestring=[b]'
}
However when I use the language as below, only in line 1 the find_system
is highlighted. I am assuming the space plays an important part on the syntax highlighting but I don't know how to configure the language or syntax highlighting to ignore the spaces after the assignment operator.
\begin{lstlisting}[language=customMatlab]
sys = find_system('x')
sys=find_system('x')
\end{lstlisting}
=
character is declared as a letter withalsoletter
, sosys=find_system
would be similar to for examplesysxfind_system
, which would also not be highlighted. If you remove=
fromalsoletter
the second line should be highlighted as well.