Andrew Yeltsin wrote:
>
> 2008/11/12, Raymond Toy <raymond.toy at ericsson.com
> <mailto:raymond.toy at ericsson.com>>:
>
>
> Andrew> And the last question today.
> Andrew> At lisp level we have expressions like this
> Andrew> ((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X)
> ((MTIMES SIMP) 8
> Andrew> ((MEXPT SIMP) $X 2))) 0)
> Andrew> They are in prefix form. Does Maxima have a
> lisp-function to convert such am
> Andrew> expression to human-readable infix form? (or infix TeX form)
>
> dipla. Use it like this:
>
> :lisp (displa '((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X)
> ((MTIMES SIMP) 8 ((MEXPT SIMP) $X 2))) 0))
>
> 2
> 8 x - 4 x - 8 = 0
>
> Be sure to that everything is on one line when typing in :lisp. It
> doesn't like it spread over multiple lines.
>
> Hope this helps,
>
> Ray
>
>
> Thank you for advise, displa woks ok.
> I tried to find a function like displa, but gives TeX-syntax output.
> I've found the "mactex.lisp" file and tried to use function "tex"
>
> The only way I cound use it was
> (%i1) :lisp (tex '((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X)
> ((MTIMES SIMP) 8 ((MEXPT SIMP) $X 2))) 0) nil nil nil nil);
> (\left( 8 \, x ^ 2 - 4 \, x - 8 = 0 \right))
>
> Am I using the right function?
You might want to use tex1 instead of tex. I'm too lazy to figure out
what all the arguments to tex really mean. :-(
But tex1 is what the maxima function tex eventually uses to produce TeX
output.
Ray