#569 mactex ignores aliases / FIX

Lisp Core (471)

Mactex ignores aliases; here is an example

(%i1) ordergreat(a);
(%o1) DONE
(%i2) tex(a);
$$_101a\leqno{\tt NIL}$$
(%o2) NIL
(%i3) build_info();

Maxima version:
Maxima build date: 12:29 5/12/2004
host type: i686-pc-mingw32
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL 2.7.0

Here is one way fix this bug; change tex-atom to

(defun tex-atom (x l r) ;; atoms: note: can we lose by
leaving out {}s ?
(if (symbolp x) (setq x (or (get x 'reversealias) x)))
(append l
(list (cond ((numberp x) (texnumformat x))
((and (symbolp x) (get
x 'texword)))
((stringp x) (tex-string x))
((characterp x) (tex-char x))
(t (tex-stripdollar x))))

Testing ...

(%i4) load("c:/maximacvs/maxima/src/mactex.lisp");

(%o4) c:/maximacvs/maxima/src/mactex.lisp
(%i5) tex(a);

$$a\leqno{\tt NIL}$$
(%o5) NIL

Ordergreat isn't all that useful, but it is a good way to
change the ordering of an expression to something more
standard for typesetting.



  • Raymond Toy

    Raymond Toy - 2004-11-23

    Logged In: YES

    Is there a reason not to apply this fix?

  • Barton Willis

    Barton Willis - 2004-11-23

    Logged In: YES

    I can't think of any reason to not apply it---I've used
    the patch a few times to help tidy tex output. For
    this purpose, it doesn't work all that well. Say I want
    all x's before y's. Using ordergreat works in a sum, but
    not in a product

    (%i1) x+y+x*y;
    (%o1) x y + y + x
    (%i2) ordergreat(x,y,z);
    (%o2) done
    (%i3) x+y+x*y;
    (%o3) y x + x + y

    (The funny \leqno{\tt ...} stuff in my first posting was due to
    a mactex bug that is no longer with us, I think).


  • Robert Dodier

    Robert Dodier - 2006-07-29
    • labels: --> Lisp Core
  • Robert Dodier

    Robert Dodier - 2006-07-29

    Logged In: YES

    Observed in 5.9.3cvs.

  • Robert Dodier

    Robert Dodier - 2006-09-09
    • milestone: --> Includes_proposed_fix
  • Robert Dodier

    Robert Dodier - 2008-01-17

    Logged In: YES
    Originator: NO

    I've pasted (if (symbolp x) (setq x (or (get x 'reversealias) x))) into TEX-ATOM and the result seems to work as expected. Committed as r1.58 src/mactex.lisp.

  • Robert Dodier

    Robert Dodier - 2008-01-17

    Logged In: YES
    Originator: NO

    Closing this report as fixed.

  • Robert Dodier

    Robert Dodier - 2008-01-17
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks