Incidentally, there are two improvements I'd recommend for your code snippet above. First, you don't need the Compute()
in the ANS
call, as $ansa
is already a MathObject, so computing it again is a waste of time.
Second, you can use $ansa
to generate the fraction in the text of the problem rather than having to write the LaTeX yourself, but you have to force it to use showMixedNumbers=>0
to get it to show as a pure fraction:
\(\{$ansa->with(showProperFractions=>0)\} =\) \{ans_rule(35)\}
That way you don't have to have the same fraction twice and run the risk of getting the two instances out of synchronization when you change the definition of $ansa
later. :-)
Davide