I suspect the keycommand and environ packages are not playing nicely together, because the following code gives an error. Can anybody explain what's going on?
\documentclass{article}
\usepackage{environ}
\usepackage{keycommand}
\usepackage{graphicx}
% Turn scalebox into an environment
\NewEnviron{scaleboxenv}[1]{%
\scalebox{#1}{\BODY}%
}
% An environment with a named argument
\newkeyenvironment{scaled}[scale=1]{%
% My real code does some more stuff here
\begin{scaleboxenv}{\commandkey{scale}}
}{%
\end{scaleboxenv}
}
\begin{document}
\begin{scaled}[scale=0.7]
Hello
\end{scaled}
\end{document}
fooI can replace\begin{foo}...\end{foo}with\foo ... \endfoo? – John Wickerson May 13 '13 at 10:58\begin{lrbox}with\lrbox. – egreg May 13 '13 at 11:03