If I have the polynomial x^2+y^2 in maxima, then maxima will display it like y^2+x^2. Is there a way to specify that the variable x will be displayed before the variable y instead?
I've figured out a way to reverse the ordering of symbols in "+" expressions, so that a goes before z. But for any given symbol, exponents are ordered the same as they are now, i.e., in decreasing order. I've posted code for this as a Github project: https://github.com/robert-dodier/maxima-mplus-symbols-reversed
There is one file of Lisp code. You can clone the Git repo or just download the one file from the project page mentioned above. Please give it a try and let me know what you think. This code changes the 2-d and 1-d console displays, and also the TeX output. I'll show only the 2-d output below; the other outputs have the same ordering of terms.
Examples:
(%i1) load("form-mplus-symbols-reversed.lisp") $
(%i2) reverse_symbols_order:true $
(%i3) x^2+y^2;
2 2
(%o3) x + y
(%i4) x^3+x^2+2*x*y+y^2;
3 2 2
(%o4) x + x + y + 2 x y
That's a little disappointing -- it's customary to put mixed terms in between x terms and y terms. But it doesn't seem possible to achieve that without a more complicated sorting heuristic, as the placement of 2*x*y relative to y^2 seems to depend on the presence or absence of x^2 -- we can't order the terms by comparing them two at a time (as in the present implementation).
For comparison here is the default ordering for the preceding expression:
(%i5) reset (reverse_symbols_order) $
(%i2) x^3+x^2+2*x*y+y^2;
2 3 2
(%o2) y + 2 x y + x + x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With