How can I get access to the name of an environment from within its own definition?
Consider, e.g.:
\documentclass{article}
\newenvironment{test}{This is som text from environment \printname :}{}
\begin{document}
\begin{test}
text
\end{test}
\end{document}
I would like \printname to give the name of the environment, such that I get the following output:

\@currenvir. That is, replace\printnamewith\@currenvir(with the accompanying\makeatletterand\makeatotherpair). However, this may be a duplicate of Command behavior depending on current environment or How can I check if the current code is inside a certain environment? – Werner May 17 '13 at 06:31