numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
202 stars 117 forks source link

Simplify doesn't always convert +- to - #800

Closed ugoertz closed 3 years ago

ugoertz commented 3 years ago

The expression \[ \simplify[zerofactor, zeroterm]{x + (-2)*y + z + 0*u } \] gives x+-2y+z (instead of x-2y+z). Similarly when the coefficients are replaced by variables. See this question for an example.

christianp commented 3 years ago

You need to include basic to rewrite +- to -.

christianp commented 3 years ago

Actually, I just did that and it didn't fix it. I'll investigate, thanks for reporting.

christianp commented 3 years ago

I think I've fixed it now. The rule didn't have "apply associativity" turned on, which meant it didn't separate out the other terms properly.