Menu

#569 mactex ignores aliases / FIX

closed
nobody
Lisp Core (457)
5
2012-12-04
2004-05-17
No

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: 5.9.0.1cvs
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))))
r))

Testing ...

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

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

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

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.

Barton

Discussion

  • Raymond Toy

    Raymond Toy - 2004-11-23

    Logged In: YES
    user_id=28849

    Is there a reason not to apply this fix?

     
  • Barton Willis

    Barton Willis - 2004-11-23

    Logged In: YES
    user_id=895922

    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).

    Barton

     
  • Robert Dodier

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

    Robert Dodier - 2006-07-29

    Logged In: YES
    user_id=501686

    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
    user_id=501686
    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
    user_id=501686
    Originator: NO

    Closing this report as fixed.

     
  • Robert Dodier

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

Log in to post a comment.