1

I'm trying to make an environment that does the follows:

\newcommand\foo[1]{does something with #1}

\newenvironment{bar}{\foo \someStartFunction}{\someEndFunction}

such that

\begin{bar}
some text
\end{bar}

expands to

\foo{some text}

My first instinct would be to place brackets { and } inside the newenvironment, but this will of course go wrong. Is there any easy way to do this; is there some kind of \someStartFunction ... \someEndFunction?

  • You are looking for the environ package. – egreg May 26 '17 at 21:17
  • @egreg Right, thank you very much. These kind of things are so difficult to find with Google since I usually don't know the correct English search terms. – Pepijn de Maat May 27 '17 at 08:34
  • Don't worry! It was a perfectly legitimate question: searching the site is not that easy if you don't know what to look for. – egreg May 27 '17 at 08:36

0 Answers0