Why the command below don't work? How can I fix it?
\documentclass[11pt]{book}
\usepackage[dvipsnames]{xcolor}
\usepackage{listings}
\lstset{language=[LaTeX]Tex,
basicstyle=\normalfont\ttfamily,
stringstyle=\rmfamily,
numbers=left,
numberstyle=\scriptsize,
stepnumber=1,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frameround=ftff,
frame=lines,
morekeywords={RequirePackage,ProvidesPackage,NeedsTeXFormat},
backgroundcolor=\color{background}
}
\definecolor{background}{HTML}{EEEEEE}
\newcommand*{\inlinecode}[1]{%
\colorbox{background}%
{%
\lstinline!#1!%
}
}
\begin{document}
ipsum dolor sit amet \inlinecode{%\@#&\newcommand=_^*} ipsum dolor sit amet
\end{document}

mathescapeoption:\lstset{mathescape=true}followed by\inlinecode|$e$.f == 0|causes the error (usingpdflatex)! Undefined control sequence. \lst@arg ->$e. Canmathescapebe supported? – Malte Schwerhoff May 04 '16 at 08:24