# [Maxima] how can I specify sort order in Maxima output?

Barton Willis willisb at unk.edu
Fri May 18 05:42:27 CDT 2007

```There is the function 'orderless.' For some tasks, you might
be able to get it to do what you want. In general, I doubt that
'orderless' will do everything that you want it to do:

(%i1) orderless(b,a,%i)\$
(%i2) a-b*%i;
(%o2) a-b*i
(%i3) a+b*%i;
(%o3) b*i+a  <-- maybe you want a + b * %i...

Barton

-----maxima-bounces at math.utexas.edu wrote: -----

>To: maxima at math.utexas.edu
>Sent by: maxima-bounces at math.utexas.edu
>Date: 05/18/2007 01:37AM
>Subject: [Maxima] how can I specify sort order in Maxima output?
>
>Hello, all,
>
>output of Maxima expressions is good but sometimes I want to prioretize.
>
>Most of all I would like to see %i at the most right end of expression.
>Also similar variables should be sorted alphabetically, IMHO.
>
>so this is okay:
>
>(%i8) a-b*%i;
>(%o8)                              a - %i b
>
>... but I would like a-b %i better.
>
>so the following:
>
>(%i1) a+b*%i;
>(%o1)                              %i b + a
>
>would be a+b%i
>
>Can this be controlled anyhow?
>