I would like to emphasise the asterisk used in \begin{equation*}
in lstlisting
. I have tried using emph
, also including the alsoletter
macro, but it doesn't work. Why not?
\documentclass{article}
\usepackage{listings,xcolor}
\begin{document}
\begin{lstlisting}[alsoletter={*},emph={*},emphstyle={\color{red}}]
% \usepackage{mhchem}
\begin{equation*}
\label{eq:chem}
\ce{CaCO3(s) <=>[H2O]
Ca2+(aq) + CO3^{2-}(aq)}
\end{equation*}
%
Some text
\end{lstlisting}
\end{document}