Exercise & Solution Page
The macros \(
and \)
don't survive \xdef
. Use $
:
\newcommand{\STA}
{%
\InitVariablesSTA
\newcommand{\factored}{$(x+\bvar)(x+\dvar)$}%
\newcommand{\expanded}{\(x^2+{\Bvar}x+\Cvar\)}%
}
Related: Build tabular content via \foreach
You might use \protected@xdef
, so \(
and \)
might be used; it's simpler the other way.