On 10/23/06, DieMongo <diemongo at yahoo.dk> wrote:
> I want to create the latex output for an equation. The latex output must be
> exactly the same as the typed in equation. Take a look at output (%o12) here
> below, it's modified a bit: -3*x is changed to +(-3)*x. ... some sort of evaluation
> is still performed
Maxima actually does not have a binary subtraction operator. The
parser treats a-b as equivalent to a+-b (in prefix form, "+"(a,"-"(b))
); and it treats -3 as "-"(3), not as the atomic number -3. The
simplifier transforms unary subtraction into multiplication by the
number -1, so a-b is represented as a+(-1)*b.
You could define your own binary subtraction syntax, but you would
also have to fix up the display routines to handle it correctly.
Currently, if you set infix("-"), a-b prints as -a (it ignores the
second argument).
-s