Consider this MWE.
DOCUMENT();
loadMacros(qw(PGstandard.pl PGML.pl contextFraction.pl));
Context("Fraction");
$f = Fraction(1/2);
$g = Compute("$f x");
BEGIN_PGML
[`[$g]`]
END_PGML
ENDDOCUMENT();
This displays $g as
\left({\frac{1}{2}}\right)x
{\frac{1}{2}}x
Parentheses are introduced because the string interpolation for "$f x" adds parentheses around $f. Then they are in the string passed to Compute, so I suspect that the hadParens property on the division operator in the parse tree is set to 1 (or something like that) and this leads to the string or TeX method on $g using those parens, even if they are not needed for order of operations precedence.
Or maybe they *are* needed for precedence? Is the implied multiplication operator a higher precedence than the division operator?
In any case, I'm wondering if there is a way to manipulate the context so that the above comes out as just
{\frac{1}{2}}xI've tried the flag showExtraParens=>0 but that does not suppress the parens here in this case.
I
know I could construct $g a different way to make the parens disappear,
but there is a whole block of exercises that I'd like to change without
micromanaging their code. If there is a context solution to this, it
would be better for what I have to do here.