I'd like to be able to define an environment that takes a single argument and be able to use that argument to redefine an existing macro such that the argument of the environment gets used automatically as the argument of the macro. Like so...
\newcommand{\argmacro}[1]{<do something with #1>}
\newenvironment{myenvironment}
{\renewcommand{\arglessmacro}{\argmacro{<the sole argument of myenvironment>}}}
{}
I'd basically like to define some text as the 'subject' of an environment such that I can perform my usual macros without having to duplicate the text each time I want to call it. Is there a clean way to reference the argument of myenvironment within the renewcommand definition? Thanks!
myenvironment
are you meaning what's between\begin{myenvironment}
and\end{myenvironment}
?