I am making some random algebra equations, and I want to have the ordering be random too, such that if my random equation generator makes
x+1, the output stays
x+1, without reverting to
I have tried
ClearAttributes[Plus, Orderless], but it simply did not work - entering
The following sort-of works:
Unprotect[Plus]; Format[Plus[a_, b_]] := ToString@a <> " + " <> ToString@b
But it uses
Unprotect, converts everything to strings, and also doesn't work when
b is a fraction (fractions
p/q are represented as
Is there a nicer way to do this?
Also, I plan to convert everything to
TraditionalForm at the end, so using that to control ordering won't work either.