how can I specify sort order in Maxima output?



On 5/18/07, Vadim <vadim at vkonovalov.ru> wrote:
>
> 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.
>

Maxima currently sorts them in reverse alphabetic order on display, with
symbolic constants then numeric constants at the end.

This is because the usual convention is that x,y,z are variables and a,b,c
are parameters, so it likes to put terms in x before those in a.

It also tries to avoid leading "-", so it displays 1-x but x-1 (with the
default negsumdispflag:true).

Flags affecting the formatting of formulas are:
        powerdisp pfeformat %edispflag exptdispflag sqrtdispflag
negsumdispflag display_format_internal
but these don't affect most of what you want....

I agree that %i+1 looks ugly, but I have not thought about the question very
generally.  If you can specify exactly what you want, it can no doubt be
programmed....

It would be fairly straightforward to write your own output formatting
routines in Lisp.  It might even be possible to write your own output
formatting routine in Maxima using simp:false and display_format_internal.

                     -s