# [texhax] environment from command

Sat Nov 20 02:10:55 CET 2010

Hi,

On Fri, Nov 19, 2010 at 09:56:28PM +0100, Barbara Sánta wrote:

> Hi, an elementary question, but I couldn't find the answer: how could
> I define an environment from a command such that an argument of it be
> inside the environment.
>
> Example:
>
> given the next command:
> \command{fix first argument}{variable second arg}{fix third arg}
>
> Construct the next environment:
> \begin{environment}
>   variable second arg
> \end{environment}

You want to catch the contents of an environment in order
to use it later as argument of a command?

\usepackage{environ}
\NewEnviron{environment}{%
\command{fix first argument}{\BODY}{fix third arg}%
}

Yours sincerely
Heiko Oberdiek