I would like to insert a custom symbol on LaTeX listings:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{stix}
\lstset{language=c,escapeinside={(*}{*)}}
\newcommand{\spc}{$\mathvisiblespace$}
\begin{document}
\lstinline{(*\spc*)} % Does not work
% This works
\begin{lstlisting}
(*\spc*)
\end{lstlisting}
\end{document}
Unfortunately, the command \spc is included literally. Is there a way to allow commands in \lstinline?
This question shows how to use escapeinside, but it does not work in my example. *\spc* is inserted literally.