janoliver
janoliver

Reputation: 7824

Latex: access the content of an environment while using \newenvironment

I'm trying to make my own environment with \newenvironment.

Is it somehow possible to access the "body" of the environment?

For example if the user uses

\begin{myenv}
    i'm the content
\end{myenv}

i want to analyze the "i'm the content" in the definition of the environment.

Thanks in advance,

Jan Oliver Oelerich

Upvotes: 2

Views: 917

Answers (1)

Alexey Malistov
Alexey Malistov

Reputation: 26975

Use package 'environ'.

\NewEnviron{myenv}{\colorbox[gray]{0.7}{\BODY}} 

where \BODY is a your "body".

Upvotes: 3

Related Questions