I am trying to combine to use mathescape together with the Erlang syntax highlighting in the package lstlisting, as described in Section 4.14 of its manual:
\documentclass{article}
\usepackage{listings}
\lstset{
language=Erlang,
mathescape=true
}
\begin{document}
\lstinline{$n_1$.lookup(k)}
\end{document}
This fails with:
! Extra }, or forgotten \endgroup.
<recently read> \egroup
l.10 \lstinline{$n_1$.lookup(k)}
The code works fine for other languages, e.g. C. Does the style for Erlang miss something to allow this?
\lstinline|$n_1$.lookup(k)|seems to work. – egreg Feb 13 at 14:36