Dear Maxima developers,
I happened to notice that the treatment of greek letter gamma in tex() can be
improved easily.
Today, to accomodate the gamma function,
(%i1) tex(gamma);
$$\Gamma$$
(%i2) tex(gamma(n));
$$\Gamma\left(n\right)$$
(%i3)
is the behavior.
With the following patch, this can changed to:
(%i1) tex(gamma);
$$\gamma$$
(%i2) tex(gamma(n));
$$\Gamma\left(n\right)$$
(%i3)
This is much nicer and natural, isn't it?
Actually, if you put the following lines in your ~/maxima-init.mac
texput(gamma,"\\gamma");
texput(gamma,lambda([arglist],block([vx],[vx]:args(arglist),concat("\\Gamma\\left(",tex1(vx),"\\right)"))))$
then above can be achieved.
So I translated it into lisp code and put it into mactex.lisp, with slight modification to the original
defprop statement for %gamma, I obtained the following patch.
I have tested this change on GCL, SBCL, CMUCL, and Clozure CL.
I would like to check in this code, so I welcome any comments on this change.
Thanks and best regards,
Yasuaki Honda
RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v
retrieving revision 1.74
diff -r1.74 mactex.lisp
469c469
< (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ...
---
> (defprop %gamma "\\gamma" texword) ; THIS IS UNFORTUNATE ...
1173a1174,1192
>
> (eval-when (:load-toplevel :execute)
> (simplify
> (mfunction-call $texput
> (trd-msymeval %gamma '%gamma)
> (m-tlambda ($arglist)
> (declare (special $arglist))
> ((lambda ($vx)
> (declare (special $vx))
> (mset '((mlist (3 "tex-gamma.mac" src)) $vx)
> (simplify ($args $arglist)))
> (simplify
> (mfunction-call $concat
> '"\\Gamma\\left("
> (simplify
> (mfunction-call $tex1 $vx))
> '"\\right)")))
> '$vx))))
> )