I would like to define a command which produces inline LaTeX listings via the package
listings. However, the language definition for LaTeX contains [] which seems
to be the cause of the error:
\documentclass{scrartcl}
\usepackage[american]{babel}
\usepackage{listings}
\newcommand*{\Lcode}{\lstinline[language=[LaTeX]TeX]}% does not work
%\newcommand*{\Lcode}{\lstinline}% works
\begin{document}
If you like LaTeX, you write \Lcode|\LaTeX| which gives \LaTeX
\end{document}
