I would like to insert a custom symbol on LaTeX listings:




\lstinline{(*\spc*)} % Does not work

% This works


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.