In the functional programming paradigm, it is common to have functions accept other functions as parameters. This paradigm can be followed in LaTeX, too: A macro can accept parameters which themselves can be macros or environment names. For this use case, the equivalent of an "identity function" is missing in LaTeX: A macro and an environment that behaves as if it wasn't there.
Basically, I am looking for something along these lines:
\documentclass{article}
\begin{document}
\newenvironment{identity}{}{}
\begin{identity}
This will be parsed as if not surrounded by anything.
\end{identity}
\end{document}
I'm reluctant to define this environment if something similar already exists in standard LaTeX or in any "standard" package. How is "identity" called in LaTeX?
verbatimenvironment. – Frank Mittelbach May 31 '12 at 14:29\begin{foo}uses\fooand\end{foo}uses\endfooif it exists, it is OK but usually not recommend to use a macro name as environment, i.e. you could simply use\begin{relax} .. \end{relax}or\begin{empty} .. \end{empty}and take advantage of\relaxand\empty. Both are basically no-op macros, which\emptyexpands to nothing but\relaxis not expandable and represents a lower-level no-op. – Martin Scharrer May 31 '12 at 14:30emptyenvironment works for me,relaxdidn't work as LaTeX complained that\endrelaxis undefined. – krlmlr May 31 '12 at 14:42! LaTeX Error: Environment relax undefined.not about\endrelax. The reason is that the used test can't differ between undefined and\relax, so it fails for\relax. I should have thought that. – Martin Scharrer May 31 '12 at 15:11