I want to create multiple versions of the same exercises sheets (teacher, students, solutions, hints,...). So I'm trying to use the "versions" package.
As I have to do it twice a week, I want to minimize the work needed every time, so I'm putting everything that I want to print in a "\shortcut" command, that I call multiple times in different versions settings.
This is what I would expect to work:
\documentclass{article}
\usepackage{versions}
\newenvironment{envA}{}{}
\newenvironment{envB}{}{}
\newcommand{\shortcut}{
\begin{envA}TEXT\end{envA}
\begin{envB}OTHER TEXT\end{envB}
}
\begin{document}
\excludeversion{envB}
\shortcut
\includeversion{envB}
\excludeversion{envA}
\shortcut
\end{document}
But I get various errors, show here (sorry for the picture, but there is a lot of them):

The very frustating part is that if I directly type the content where I want to appear, it works and produces the expected result:
\documentclass{article}
\usepackage{versions}
\newenvironment{envA}{}{}
\newenvironment{envB}{}{}
\begin{document}
\excludeversion{envB}
\begin{envA}TEXT\end{envA}
\begin{envB}OTHER TEXT\end{envB}
\excludeversion{envA}
\includeversion{envB}
\begin{envA}TEXT\end{envA}
\begin{envB}OTHER TEXT\end{envB}
\end{document}
Anyone can help ?
