Consider the following MWE:
\documentclass[a4paper]{article}
\usepackage{environ}
\NewEnviron{myitemize} {
\show\BODY
\begin{itemize}
\BODY
\end{itemize}
}
\begin{document}
\begin{itemize}
\item \verb|test|
\end{itemize}
\begin{myitemize}
\item \verb|test|
\end{myitemize}
\end{document}
The first list works, but the second one throws Latex errors (missing } inserted, extra }, \verb illegal ...). It has probably something to do with the way NewEnviron collects it's body but can someone elaborate on this problem.
Log file shows:
> \BODY=macro:
->\item \verb |test|.
so why is there a problem? And of course, what is the solution?
\renewenvironment{verbatim}[1]{\begingroup\ttfamily #1}{\endgroup}– Jesse op den Brouw Aug 17 '18 at 20:08\colorboxon the verbatim. How to do that? All it does is throw errors at me. – Someone Apr 14 '20 at 15:43\colorbox. – Werner Apr 14 '20 at 21:46