I'm trying to create a new environment on top of tcblisting (from tcolorbox package) using environ package. Getting weird error about Runaway argument. The MWE:
\documentclass{book}
\usepackage{tcolorbox}
\usepackage{environ}
\tcbuselibrary{listings}
\NewEnviron{CodeListing}[2][]{%
\begin{tcblisting}{listing only}
\BODY
\end{tcblisting}
}
\begin{document}
\begin{CodeListing}
bool someVar;
\end{CodeListing}
\end{document}
The error is
Runaway argument?
! File ended while scanning use of \next.
<inserted text>
\par
<*> mwe.tex
If I remove the tcblisting environment in the new environment, Everything is fine. What is going wrong here ?
tcblistingenvironment inside the new command. – Surya Aug 25 '13 at 04:23tcblisting) can't be placed in a macro argument. See this related thread: http://tex.stackexchange.com/q/86705/27635. – karlkoeller Aug 25 '13 at 05:39