\documentclass[12pt]{article}
\usepackage[test]{optional}
\begin{document}
\def\optname{test}
\optname \\ % Prints "test"
\opt{\optname}{
TEST % does nothing
}\\
\opt{test}{
TEST 2 % behaves as expected
}
\end{document}
The above minimal example uses the "optional" package to compile different Versions of the same document. Now I'd like to expand it that the \opt command uses a predefined variable to determine in which version which part of the document gets compiled. The Problem is, that it does not accept the variable. I feel it's some kind of expansion issue, but i haven't found any solution yet.