1

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:

enter image description here

Browse other questions tagged or ask your own question.