Re: Subscripted vars, display problem [Fixed]



[Forwarded to the Maxima mailing list with Dr. Finken's permission.]

    From: Reimar Finken <finken at theo2.physik.uni-stuttgart.de>
    Date: 10 May 2006 12:01:43 +0200

    Hello Jonathan,

    [sorry to reply to you by email rather than to the
    maxima list.

Dear Reimar

I appreciate it; email is more reliable for me than
mailing-list software.

    I usually only read the discussion via the gmane nntp
    gateway, meaning that I can't post to the list without
    having subscribed. Feel free to forward my answer to
    the maxima discussion list if you think it might be
    helpful to anyone else.]

    since no one responded to your imaxima display
    problem, I will give it a try, although I have to
    warn you that I am nowhere nearly as knowlegable
    about Lisp as the regulars on this list.

    squash at math.ufl.edu (Jonathan LF King) writes:
    > ... because of a display problem. ...
    /--------------------------------------------------------\
    > (%I132) display2d : imaxima ;
    >
    > (%I133) rand[i,j] := random(10);
    >
    > Maxima encountered a Lisp error:
    >
    > EVAL: too many parameters for special operator IF: (IF (ATOM (CADR X))
    >  (PROGN
    >   (SETQ L (TEX (TEXWORD F) L NIL LOP 'MFUNCTION) R
    >    (NCONC (TEX-LIST (CDR X) NIL (LIST "}") ",") R))
    >   (NCONC L (LIST "_{") R))
    >  (SETQ L (TEX (TEXWORD F) (APPEND L (LIST "\\isubscript{")) NIL LOP 'MFUNCTION)
    >   R (NCONC (TEX-LIST (CDR X) NIL (LIST "}") ",") R))
    >  (NCONC L (LIST "}{") R))
    >
    > \________________________________________________________/
    >
    > FWIW, I run Gentoo Linux and the CL is I use is Clisp.
    >
    > Is the-above likely to be a problem with *my* Emacs setup,
    > or with the way that Gentoo installs Clisp+Maxima+Imaxima?

    I can't say anything about Gentoo, but it seems that
    your Imaxima installation is not quite up to
    date. This bug does not occur for me
    (imaxima-imath-0.94).  I don't know how to easily
    check for the version number of your imaxima
    installation. The version numbers in imaxima.el and
    imaxima.texi in my installation contradict each
    other, implying that they are not maintained.

    You can either download and install a recent version
    of imaxima from

    http://members3.jcom.home.ne.jp/imaxima/Site/Welcome.html

Thank you, Reimar --that did the trick.  Once I arranged
that the new "imaxima.el" *and* the new "imaxima.lisp" were
loaded, the problem went away.

    (although I don't know how that would interfere with
    your existing installation) or submit a Gentoo bug
    report.

I will submit a request to Gentoo to upgrade.

    Or you can fix this particular bug yourself provided
    you can edit the file imaxima.lisp, which you can find
    via [ C-h v imaxima-lisp-file RET ].

    The bug you observe is in the function tex-array
    [search for `(defun tex-array']. The two Lisp forms
    at the very end of the function

    ,----
    | (setq l (tex (texword f) (append l (list "\\isubscript{"))  nil lop 'mfunction)
    |       r (nconc (tex-list (cdr x) nil (list "}") ",") r))
    | (nconc  l (list "}{") r )
    `----

    must be surrounded by a (progn ...). For the record,
    here is the full function definition of tex-array in
    my installation:

    ,----
    | (defun tex-array (x l r)
    |   (let ((f))
    |        (if (eq 'mqapply (caar x))
    |      (setq f (cadr x)
    |            x (cdr x))
    |      (setq f (caar x)))
    |        (if (atom (cadr x))
    |      ;; subscript is an atom -- don't use \isubscript
    |      (progn
    |        (setq l (tex (texword f) l nil lop 'mfunction)
    |              r (nconc (tex-list (cdr x) nil (list "}") ",") r))
    |        (nconc l (list "_{") r))
    |    (progn
    |      (setq l (tex (texword f) (append l (list "\\isubscript{"))  nil lop 'mfunction)
    |            r (nconc (tex-list (cdr x) nil (list "}") ",") r))
    |      (nconc  l (list "}{") r )))))
    `----

    Simply saving the edited file and restarting imaxima
    should solve your problem.

    I hope that helped,

It certainly did.  Maybe I should sent ALL my problems to
you... have you any idea how I can get my children to
clean-up their bedrooms?   

                        Best Wishes, -Jonathan

    ...
    Reimar
    --
    Dr. Reimar Finken    (finken at theo2.physik.uni-stuttgart.de)
    II. Institut f??r Theoretische Physik, Universit??t Stuttgart
    Pfaffenwaldring 57                       Tel: 0711-68564924
    70550 Stuttgart, Germany                 Fax: 0711-68564902

-- 
Prof. Jonathan LF King   Mathematics dept, Univ. of Florida
<squash at math.ufl.edu>,   <http://www.math.ufl.edu/~squash/>;