What's the easy way to display a multilinear equation as sorted on its coefficients? For instance, display
7 + 3x[1] - 2x[2] + x[3]
as
7 - 2x[2] + x[3] + 3x[1]
I'm now converting the equation into a list of {coefficient, variable} pairs, sorting on the first component, and then constructing the desired display. It's easy enough but I'm hoping there's an easier way.
Thanks.