Why does the MWE below compile with errors only if I use ths \lstnewenvironment
line? And how to define the verbatim macro inside an environment? I heard it's possible using plain TeX?
\documentclass{article}
\makeatletter
\IfFileExists{randompackageyoudonthave.sty}{
}{
\usepackage{listings}
\lstnewenvironment{Rcode}{\renewcommand\lstlistingname{Rcode}}% deleting this line makes this work
\newcommand{\code}[1]{\lstinline{##1}}
}
\makeatother
\begin{document}
\code{yeah! some code}
\end{document}