(2) Can I define a function f(a,b) in Maxima, which works like "foo
a,b" or like "foo a b".
Thanks for any answers
Rene
> (1) Can I change the tex() command to output \frac{a}{b} instead of {a
> \over b} at the command tex(a/b).
There are a few ways to do it.
(a) load("mactex-utilities.lisp");
which redefines TeX properties for "/" and matrix(...)
(b) or just put this in a file and load it: (copied from mactex-
utilities)
(defun tex-mquotient (x l r)
(if (or (null (cddr x)) (cdddr x)) (wna-err (caar x)))
(setq l (tex (cadr x) (append l '("\\frac{")) nil 'mparen 'mparen)
r (tex (caddr x) (list "}{") (append '("}") r) 'mparen 'mparen))
(append l r))
(c) or this Maxima program: (recently added feature, not sure
when it appeared)
texdiv (e) := concat ("\\frac{", tex1 (first (e)), "}{", tex1 (second
(e)), "}");
texput ("/", texdiv);
> (2) Can I define a function f(a,b) in Maxima, which works like "foo
> a,b" or like "foo a b".
I don't see a way to do it. prefix("foo") tells Maxima to recognize
foo a as operator foo with argument a, but foo a b fails to parse,
and foo a, b parses, but not as you want it (it is equivalent to
ev(foo a, b)). You could write foo [a, b] (so there is one argument,
a list) but that's no better than foo(a, b).
Hope this helps
Robert Dodier
PS. Questions about Maxima are better directed to the Maxima
mailing list. http://maxima.sourceforge.net/maximalist.html
(a) does not work, because I do not have "mactex-utilities.lisp" in my
distribution (5.16 for Windows). There is only a file mactex.lisp,
which does not do the trick. (b) worked, thanks! (c) does not work, I
tried that already. It still uses \choose.
I might add that I use Maxima as a CAS for Euler, so there might be
some specials. But essentially, Maxima should work completely as
expected.
Thanks
Rene Grothmann
PS: I asked the question in the maximalist mailing list at utexas. I
was not aware of the Sourceforge list.
Rene> But essentially, Maxima should work completely as
Rene> expected.
What does that mean? That Maxima is working or that Maxima is not
working?
Rene> PS: I asked the question in the maximalist mailing list at utexas. I
Rene> was not aware of the Sourceforge list.
The real list is at utexas. I don't think anyone reads the
Sourceforge list. (At least on a regular basis. I certainly don't.)
Ray