I am writing some lecture notes, and I would like to have automatically generated two versions. One version includes everything (examples, additional explanations, etc.), and another one with only the essential information (definitions, theorems, etc.). My current approach is/was to utilize the ifthenelse package as follows:
\newenvironment{optional}
{
\ifthenelse{\boolean{opt}}{
}
{
}{}
}
so that I could use the environment
\begin{optional}
some optional information.
\end{optional}
Setting the boolean accordingly, I would generate each version of the lecture notes.
The problem is, of course, that there is a mismatch of braces in my \newenvironment statement that causes trouble with parsing. How can I solve that?
\bgroup…\egrouptrick will work for most commands, but alas, because of how TeX's parsing works combined with environment definitions, my original suggestion doesn’t work. I’ve put in a new version above. – Don Hosek Oct 25 '23 at 16:38