HOW TO INSTALL MAXIMA.

In This memo, I summarised how to install maxima(<=5.6) and some useful applications. I had checked on my linux systems, P!!! 600MHz(SuSE 7.1), Macintosh G4 800MHz(SuSE 7.1), P!!! 1.3MHz(SuSE 8.2) and P4 1.6MHz( SUSE 9.0). I'm not a good English speaker and writer, but I hope this memo would be some help for you. The latest version of maxima is 5.9.0. The installation of 5.9.0 is easyer than 5.6. you can compile it only executing configure; make;make install. But maxima-2004-04-24 has problems. Please see memo for maxima-2004-04-24. Now this memo is somewhat old, but corrections for 5.6 are useful for 5.9.0 and maxima-2004-04-24 and understanding the mechanism of functions.

  1. Preparations

    Common lisp is needed to build maxima. I have used gcl and clisp. gcl had been the standard, clisp not (for maxima<=5.6). But clisp works on many environments which gcl doesn't. From maxima-5.9pre, gcl is no longer standard for Maxima and clisp is one of standards. (The other standard is CMUCL).

  2. Building MAXIMA(<=5.6)

    In this section, I mention the compilation of maxima(<=5.6). If you would try maxima-5.9(pre), the step is different from this memo. maxima-5.9.0 is very easy to install, only execute "./configure; make ; make install". maxima-2004-04-24 is same. But it needs some corrections. Please see memo for maxima-2004-04-24. Some corrections in this memo are yet needed for maxima to work correctly.

    Appendix:timer and trace

    timer and trace don't works in maxima on clisp. These due to the difference of gcl and clisp.

    At the first, timer is failed at trace-fshadow in mtrace.lisp. The error occures in the evaluation of (setf (symbol-function fun) value) at 311-th row of mtrace.lisp. I replace value to (eval value) as follows:

    trace-fshadow(311th row)

        307 (defun trace-fshadow (fun type value)
        308    (let ((shadow (get! type 'shadow)))
        309       (cond ((memq shadow '(expr subr))
        310              (setf (trace-oldfun fun) (and (fboundp fun) (symbol-function fun)))
        311              (setf (symbol-function  fun)  (eval value)))
        312             ((memq shadow '(fexpr fsubr))
        313              (setf (trace-oldfun fun) (symbol-function fun))
        314              (setf (symbol-function  fun)  (cons 'nlambda (cdr value))))
        315             (t (setplist fun
        316                          `(,shadow ,value ,@(symbol-plist fun)))))))
    		  

    After the above correction, timer and trace work correctly. But untrace dosen't work. The problem occures at trace-unfshadow in mtrace.lisp. The argument fun of trace-unfshadow is not LIST on clisp, so the following evaluations return nill.

    (and (fboundp fun)
    (consp (setq new-fun (symbol-function func))
    (consp (second new-fun))
    (among 'trace-args (second new-fun)))
    	

    And fun isn't replaced to oldfun. At last trace-unfshadow returns the message: "This function was no longer defined as an interpreted-traceremains func.".

    But maxima on gcl works correctly. This can explained by the following example:

    gcl case

    >(defun tama (x) (* x 2))
    
    TAMA
    
    >(type-of `tama)    
    
    SYMBOL
    
    >(setf aa (symbol-function `tama))
    
    (LAMBDA-BLOCK TAMA (X) (* X 2))
    
    >aa
    
    (LAMBDA-BLOCK TAMA (X) (* X 2))
    
    >(type-of aa)
    
    CONS
    		  

    clisp case

    [117]> (defun tama (x) (* x 2))
    TAMA
    [118]> (type-of `tama)
    SYMBOL
    [119]> (setf aa (symbol-function `tama))
    #<CLOSURE TAMA (X) (DECLARE (SYSTEM::IN-DEFUN TAMA)) (BLOCK TAMA (* X 2))>
    [120]> (type-of aa)
    FUNCTION
    		  

    In the above example, I define a function tama and execute (setf aa (symbol-function 'tama)). Then aa is LIST in gcl, but it is FUNCTION in clisp. FUNCTION-type causes cdr to return error.

    I modified trace-unfshadow as follows:

    modified trace-unfshadow

        334 (defun trace-unfshadow (fun type &aux new-fun)
        335   (cond ((and(fboundp fun)
        336              (functionp (trace-oldfun fun)))
        337   (cond ((memq type '(expr subr fexpr fsubr))
        338          (let ((oldf (trace-oldfun fun)))
        339            (if (not (null oldf))
        340              (setf (symbol-function  fun)  oldf)
        341              (fmakunbound fun))))
        342          (t (remprop fun (get! type 'shadow))
        343             (fmakunbound fun))))
        344         (t  (format t "~%This function was no longer defined as an interpreted-trace"))))
        345 ;  (cond ((and (fboundp fun)
        346 ;             (consp (setq new-fun (symbol-function func))
        347 ;             (consp (second new-fun))
        348 ;             (among 'trace-args (second new-fun)))
        349 ;  (cond ((memq type '(expr subr fexpr fsubr))
        350 ;        (let ((oldf (trace-oldfun fun)))
        351 ;          (if (not (null oldf))
        352 ;            (setf (symbol-function  fun)  oldf)
        353 ;            (fmakunbound fun))))
        354 ;        (t (remprop fun (get! type 'shadow))
        355 ;           (fmakunbound fun))))
        356 ;       (t  (format t "~%This function was no longer defined as an interpreted-trace"))))
        357 
    		  

    After the above modifications, timer, trace and untrace work correctly.

    Appendix: parametric plot

    For maxima graphics test, execute the following:

    plot2d([x^3+2,[parametric,cos(t),cos(t)*sin(t),[t,-5,5]]],[x,-3,3]);
    		

    "parametric plot" works fine? If your maxima warns "can't find omplotdata", check the value of MAXIMA_DIRECTORY. omplotdata must be in (your installed directory)/maxima-x.x/bin, so MAXIMA_DIRECTORY should be (your installed directory)/maxima-x.x.

  3. Symmetries

    You can operate symmetric polynomials with the symmetries package. The source is included in sym directory of maxima-5.6. To use symmetries for Maxima-5.6 in clisp, you should add corrections to source files and compile it. Almost same ocrrections are needed for maxima-5.9.0. But in maxima-5.9.0, the suffixes of files are changed from .lsp to .lisp ( for example, compile.lsp in 5.6 is renamed to compile.lisp in 5.9.x ) and it's directory is placed under share directory and the objects are placed under the other directoy under src, for example, binary-clisp for clisp. So you must change the path for the memory-image file of maxima in makefile. So if you want to use the symmetry package, you should take care of filenames and the place where the memory-image file is placed.

    If you choose gcl for maxima-5.9, then you should edit compile.lsp and make. But you choosed the other, especially clisp, then you should correct source files. In many cases, ")" are too many, and In operations.lsp, the problem is that the variable $oper is undefined on clisp. The following is load "compile.lsp" on CLISP in sym directory. An error occurred.

    Example:compile error at (load "compile.lisp")

    [18]>(load "compile.lsp")
    ...[snip]...
    Compiling file /usr/local/maxima-5.6/sym/operations.lsp ...
    WARNING in function #:TOP-LEVEL-FORM-2 in line 24 :
    OPERATIONS is neither declared nor bound,
    it will be treated as if it were declared SPECIAL.
    *** - READ from #<BUFFERED FILE-STREAM CHARACTER 
    #P"/usr/local/maxima-5.6/sym/operations.lsp" @34>: 
    an object cannot start with #\)
    1. Break MAXIMA[19]> 
    		  

    In the above example, "@34" means that in the line number, there are a problem. In this example, the 34th line has too many ")"s.To return clisp prompt, enter Ctrl+D.

    I mention some corrections of the symmetries package. But I checked the commands only with examples of Symmetries.texi. So my check is not perfect. The followings are the corrections of source files. If you modify these files, you should execute "make install". By this execution, these files are installed these's destinations. If you call the function of Symmetries package at first, maxima compiles Symmetries paxkage of the destination.

    1. makefile(clisp only)

      To make with clisp, replace execute maxima with your clisp-maxima. The following is an example. The corrections are execution of maxima. My clisp-maxia named macsyma is placed on /usr/local/bin.

      makefile(modified)

      all:
              echo '(proclaim (quote(optimise (safety 0))))(in-package "MAXIMA")(load "compile.lsp")' \
              | /usr/local/bin/macsyma
      
      
      all:
              echo 'load("compile.lsp");' |  /usr/bin/clisp -norc -M /usr/local/maxima/src/maxima-clisp.mem
      
      
      doc:
              latex docsym.tex
      
      clean:
              rm -f *.aux *.dvi *.toc *.log
              rm -f *.o
      
      tar:
              (cd .. ; tar cvf - sym/makefile sym/*.lsp sym/*.tex sym/doconline sym/*.mac src/max_ext.lisp doc/macsym.doc doc/macsym-index.LISP ) | gzip -c > sym.tgz
      		      
    2. compile.lsp

      compile.lsp specifies files to compile. But resolvante.lsp doesn't exist. It may be resolvante.mac. So I replaced it with resolv1.lsp as follwos;

      compile.lsp(modified)

      ;; Fichier compile.lsp
      (proclaim '(optimize (safety 0)))
      ;       ***************************************************************
      ;       *                    MODULE SYM                               *
      ;       *       MANIPULATIONS DE FONCTIONS SYMETRIQUES                *
      ;       *        (version01: Commonlisp pour Maxima)                 *
      ;       *                                                             *
      ;       *                ----------------------                       *
      ;       *                  Annick VALIBOUZE                           *
      ;       *                    GDR MEDICIS                              *
      ;       *  (Mathe'matiques Effectives, De'veloppements Informatiques, *
      ;       *           Calculs et Ingenierie, Syste`mes)                 *
      ;       *             LITP (Equipe Calcul Formel)                     *
      ;       *                 Universite' Paris 6,                        *
      ;       *        4 place Jussieu, 75252 Paris cedex 05.               *
      ;       *              e-mail : avb@sysal.ibp.fr                      *
      ;       ***************************************************************
      
      (compile-file '|arite.lsp|)
      (compile-file '|chbase.lsp|)
      (compile-file '|direct.lsp|)
      (compile-file '|elem.lsp|)
      (compile-file '|kak.lsp|)
      (compile-file '|ecrivain.lsp|)
      (compile-file '|lecteur.lsp|)
      (compile-file '|macros.lsp|)
      (compile-file '|multmon.lsp|)
      (compile-file '|partpol.lsp|)
      (compile-file '|permut.lsp|)
      (compile-file '|pui.lsp|)
      (compile-file '|resolv1.lsp|)
      (compile-file '|schur.lsp|)
      (compile-file '|treillis.lsp|)
      (compile-file '|tri.lsp|)
      (compile-file '|util.lsp|)
      (compile-file '|operations.lsp|)
      ;(compile-file '|resolvante.lsp|)
      		      
    3. direct.lsp

      In this file, there are too many ")" on the 122th line. You should delete last ")".

      The function which has 122th line.

          114 (defun contient (list$pol $pol)
          115    (catch 'trouve
          116        (progn
          117          (mapc #'(lambda ($pol2)
          118                   (and (meval (list '($is)
          119                                     (list '(mequal) $pol $pol2)))
          120                               (throw 'trouve t)))
          121                list$pol)
          122          nil))))
                             ^delete this ")".
      		      
    4. operations.lsp

      There are many errors in operations.lsp. The first, too many ")"s at 34th, 50th and 79th lines. The functions are:

      the function which has the 34th line

           33 (defun $ratfmult (ll)
           34   (meval (list '($rat) (cons '(mtimes) ll))))))
                                                           ^^delete two ")"s.
      		      

      the function which has 50th line

           49 (defun $expandfadd (l)
           50   (meval (list '($expand) (cons '(mplus) l))))))
                                                            ^^delete two ")"s.
      		      

      the function which has 79th line

           78 (defun $mevalfadd (l)
           79    (meval (cons '(mplus) l)))))
                                           ^^delete two ")"s.
      		      

      There are problems of function $operation in operatoins.lsp. At the first, the manner of using lambda in symmetries is not good for clisp.

      $operation(original)

           95 (defun $operation ()
           96   (cond
           97     ((equal $oper prefixe))
           98     (t (mapc '(lambda (corps nom_oper)
           99                 (setf (symbol-function nom_oper) corps))
          100             (mapcar '(lambda (suffixe)
          101                        (symbol-function
          102                            (flet ((franz.concat (&rest args)
          103                                    "equivalent to Franz Lisp 'concat'."
          104                                    (values
          105                                     (intern
          106                                      (format nil "~{~A~}" args)))))
          107                              (franz.concat $oper suffixe))))
          108                     '(moins mult add divi exp fadd fmult))
          109             '($moins_sym $mult_sym $add_sym $divi_sym $exp_sym
          110                  $fadd_sym $fmult_sym))
          111       (setq prefixe $oper))))
      		      

      With "mapc '(lambda" and "mapcar '(lambda", $operation doesn't work correctly for CLISP. These should be replaced with "mapc #'(lambda" and "mapcar #'(lambda". The modified $operation is the following:

      $operation(modified)

          95 (defun $operation ()
          96   (cond
          97     ((equal $oper prefixe))
          98     (t (mapc #'(lambda (corps nom_oper)
          99                 (setf (symbol-function nom_oper) corps))
         100              (mapcar #'(lambda (suffixe)
         101                         (symbol-function
         102                             (flet ((franz.concat (&rest args)
         103                                     "equivalent to Franz Lisp 'concat'."
         104                                     (values
         105                                      (intern
         106                                       (format nil "~{~A~}" args)))))
         107                               (franz.concat $oper suffixe))))
         108                      '(moins mult add divi exp fadd fmult))
         109              '($moins_sym $mult_sym $add_sym $divi_sym $exp_sym
         110                   $fadd_sym $fmult_sym))
         111        (setq prefixe $oper))))
      		      

      At the last, The value $oper must be defined, but $oper is undefined in operations.lsp on CLISP. In the comment for $oper, it supposed that $oper is $rat. So I imposed (setq $oper '$rat) next line of (setq prefixe 'depart) at 85th line.

    5. util.lsp

      In 141th line and 294th line, ")" are too many.

      The function which has 141th line.

          138 (defun $degre (mon)
          139   (if (or (constantp mon) (null mon)) 0
          140       (+  (* (car mon) (cadr mon))
          141           ($degre (cddr mon))))))
                                              ^delete this ")".
      		      

      The function which has 294th line.

          284 (defun lex_mon (m1 m2)
          285   (and (not (equal m1 m2))
          286        (catch 'trouve
          287                (mapc #'(lambda (e1 e2)
          288 
          289                       (or (eql e1 e2)
          290                           (cond
          291                             ((> e1 e2)
          292                              (throw 'trouve t))
          293                              (t (throw 'trouve nil)))))
          294                    m1 m2)))))
                                          ^delete this ")".
      		      
    6. schur.lsp

      After the above corrections, the compilation is passed. But mon2schur dosen't work perfectly. To work mon2schur, change duale21 and 2duale21 to old definitions which are comment-outed.

      duale21 and 2duale21(modified)

          197  (defun duale21 (partition)
          198    (let ((m1 (cadr partition)))
          199   (2duale21 (cddr partition) (list m1)
          200            (* m1 (car partition))
          201           m1)))
          202  (defun 2duale21 (part2 part1 p1 p2)
          203    (cond ((null part2)
          204           (nconc part1
          205                  (make-list
          206                      (- p1 p2) :initial-element 1)))
          207         (t (let ((nxpart (+ (cadr part2) (car part1))))
          208           (2duale21 (cddr part2)
          209                    (cons nxpart
          210                          part1)
          211                        (+ p1 (* (car part2) (cadr part2)))
          212                       (+ p2 nxpart))))))
          213 ;(defun duale21 (partition)
          214 ;  (let ((lmultiplicites_lparts
          215 ;            (chmultiplicites_parts partition nil nil)))
          216 ;    (2duale21 (car lmultiplicites_lparts)
          217 ;        (cons 0 (cdr lmultiplicites_lparts)) nil)))
          218 ;(defun 2duale21 (lmulti lpart partition1_duale)
          219 ;  (cond
          220 ;    ((null (cdr lmulti))
          221 ;     (nconc partition1_duale
          222 ;            (make-list
          223 ;                (- (cadr lpart) (car lpart))
          224 ;                 :initial-element  (car lmulti))))
          225 ;    (t (2duale21 (cdr lmulti) (cdr lpart)
          226 ;           (nconc partition1_duale
          227 ;                  (make-list
          228 ;                        (- (cadr lpart) (car lpart))
          229 ;                       :initial-element  ($fadd_sym lmulti)))))))
          230 ;
      		      
    7. resolv1.lsp

      If you specify CAYLEY switch and execute resolvante command, then the error occures to load resolcayley.lsp. In resolv1.lsp, there are the load command:

      loading resolcayley in resolvante

           58 (defun resolvante ($pol $var $fonction_resolvante $list_var)
           59      (cond  ((equal '$cayley $resolvante)
           60                  (print " resolvante de Cayley ")
           61                  (load "resolcayley.lsp")
      		      

      At 61th line, maxima missed resolcayley.lsp. So I specify resolcayley.lsp directly. To do this, replace "(load "resolcayley.lsp")" to "(load "/usr/local/maxima/sym/resolcayley.lsp")".

    8. Compilation of the symmetries package.

      After these corrections, do make on the sym/ directory. and execute "make install" at src directory. To use the symmetries package, you may specify the commands of the symmetries package.

      ponpoko@clavius:~ > macsyma 
        i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo 
        I I I I I I I      8     8   8           8     8     o  8    8
        I  \ `+' /  I      8         8           8     8        8    8
         \  `-+-'  /       8         8           8      ooooo   8oooo
          `-__|__-'        8         8           8           8  8
              |            8     o   8           8     o     8  8
        ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8
      
      Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
      Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
      Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
      Copyright (c) Bruno Haible, Sam Steingold 1999
      
      Maxima 5.6 日 7月 8 14:00:42 JST 2001 (with enhancements by W. Schelter).
      Licensed under the GNU Public License (see file COPYING)
      (C1) RATSIMP(PUIREDUC(3,[2]));
      RESOLVANTE 
      GENERALE 
       
      NOTE: To compile the system do 
       cd  /usr/local/maxima-5.6/sym/ ;make 
      ;; Loading of file /usr/local/maxima-5.6/sym/macros.fas is finished.
      [snip]
      ;; Loading of file /usr/local/maxima-5.6/sym/resolv1.fas is finished.Warning - you are redefining the MACSYMA function RESOLVANTE_PRODUIT_SYM
      Warning - you are redefining the MACSYMA function RESOLVANTE_UNITAIRE
      Warning - you are redefining the MACSYMA function RESOLVANTE_ALTERNEE1
      Warning - you are redefining the MACSYMA function RESOLVANTE_KLEIN
      Warning - you are redefining the MACSYMA function RESOLVANTE_KLEIN3
      Warning - you are redefining the MACSYMA function RESOLVANTE_VIERER
      Warning - you are redefining the MACSYMA function RESOLVANTE_DIEDRALE
      Warning - you are redefining the MACSYMA function RESOLVANTE_BIPARTITE
                                                        3
                                            3 P1 P2 - P1
      (D1)                      [2, P1, P2, -------------]
                                                  2
      (C2) mon2schur([1,2]);
                                         2
      (D2)/R/                       X2 X1  + 2 X3 X2 X1
      (C3) 
      		      

      If it failed to load commands, do "load(sym1);".

  4. affine

    To use the affine package, you must edit makefile in it and execute make saved_affine.

    You must set values to SRC, SAVEDKCLDIR, and MAXDIR for your system like followings:

    SRC = /usr/local/maxima-5.6/src
    SAVEDKCLDIR =/usr/src/packages/BUILD/gcl-2.3/unixport
    MAXDIR=/usr/local/lib/maxima-5.6
    		

    SRC is the source directory of maxima. MAXDIR is the destination and SAVEKCLDIR is unixport directory of gcl. It may be set to unixport directory of the gcl's building directory as the above. After these modifications, do "make saved_affine".

    To use maxima with the affine package, it is easy to use an script same as maxima executable script as following:

    /usr/local/bin/maxima

    #!/bin/sh
    export MAXIMA_DIRECTORY
    MAXIMA_DIRECTORY=/usr/local/lib/maxima-5.6
    exec /usr/local/lib/maxima-5.6/src/saved_maxima -dir /usr/local/lib/maxima-5.6/src/ $@
    		

    This script sets MAXIMA_DIRECTORY and executes saved_maxima. To use affine, you make a copy of the executable script maxima in your favorite name, for example, "affine" and change saved_maxima to saved_affine as following:

    /usr/local/bin/affine

    #!/bin/sh
    export MAXIMA_DIRECTORY
    MAXIMA_DIRECTORY=/usr/local/lib/maxima-5.6
    exec /usr/local/lib/maxima-5.6/affine/saved_affine -dir /usr/local/lib/maxima-5.6/src/ $@
    		

    If you type affine, then maxima with the affine package starts up:

    GCL (GNU Common Lisp)  Version(2.3) Wed May 16 23:46:46 JST 2001
    Licensed under GNU Library General Public License
    Contains Enhancements by W. Schelter
    Maxima 5.6 Wed May 16 23:46:41 JST 2001 (with enhancements by W. Schelter).
    Licensed under the GNU Public License (see file COPYING)
    (C2) 
    		

    At first,solve the equations {2*x+y=1,x+2*y=2} with Groebner basis.

    (C3) grobner_basis([2*x+y-1,x+2*y-2]);
    (D3)/R/                        [- y + 1, - x]
    		

    It works fine.

    With the affine package, POLYSIMP calculates the modulus of the ideal generated with GROBNER_BASIS:

    (C14) GROBNER_BASIS([3*X^2+1,Y*X]);
    
    eliminated one
     . 0 . 0
                                              2
    (D14)/R/                       [- Y, - 3 X  - 1]
    (C15)  POLYSIMP(Y^2*X+X^3*9+2);
    
    (D15)/R/                           - 3 X + 2
    (C16)  POLYSIMP(Y^2*X+X^3*9+2*Z);
    
    (D16)/R/                           2 Z - 3 X
    
    		

    The polynomial Y^2*X+X^3*9+2*Z is an element of the rational polynomial ring Q[X,Y,Z] and the POLYSIMPed value of (D16) is an enelemt of Q[X,Y,Z]/<Y,3*X^2-1>.

    Next, calculate GROBNER_BASIS([X,Y]) first and POLYSIMPs the given polynomial:

     
    (C17)GROBNER_BASIS([X,Y]);
    
    (D17)/R/                          [- Y, - X]
    (C18)  POLYSIMP(Y^2*X+X^3*9+2*Z);
    
    (D18)/R/                              2 Z
    		

    By (C17), the former POLYSIMP's results are reset,then the next result of POLYSIMP are changed. We can define the complex number with C=R[X]/< X^2+1 >

    
    (C19) GROBNER_BASIS([X^2+1]);
    
                                          2
    (D19)/R/                           [-x  - 1]
    (C20) POLYSIMP(X^2+2*X+1);
    
    (D20)/R/                              2 X
    (C21) POLYSIMP(X^4+3*X^3+9*X+1);
    
    (D21)/R/                            6 X + 2
    
    		
  5. xgraph

    If your system is linux and has glibc2.2, you need edit xtb.c. Comment out "extern char *strcpy();" at the 49th line. To compile, first, xmkmf -a, and make install.xgraph installed to /usr/X11R6/bin/.

  6. Geomview

    To get geomview source code and binary, visit http://www.geomview.org/.

    To make Geomview, MesaGL is necessary. Some external modules, like maniview, need xforms library. If your system is Debian GNU/LINUX, the geomview package doesn't include xforms and compiled with flag configure --without-xforms. If your system is GNU/Linux and glibc-2.2.x and g++-2.95.2, fails to compile. In detail, please see "FAQ 2.34 when compiling G++ C++ programs" in glibc documentation. You can get a patch from http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff .

    To use geomview in maxima, set the global variable PLOT_FORMAT to geomview with SET_PLOT_OPTION([PLOT_FORMAT,geomview]); or set an option of plot3d like plot3d(2^(x^2-y^2),[x,-1,1],[y,-2,2],[plot_format,geomview]).

    An example:

    (C8) plot3d([5*cos(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0) - 10.0,
              -5*sin(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0),
               5*(-sin(x/2)*cos(y)+cos(x/2)*sin(2*y))],
               [x,-%pi,%pi],[y,-%pi,%pi],['grid,40,40]);
    		

  7. TeXmacs

    You can get TeXmacs from http://www.texmacs.org. TeXmacs needs guile-devel (for RedHat. guile for SuSE). To install TeXmacs, you would execute the following steps, 1) execute ./configure, 2) execute make and make install. To Use TeXmacs as a front-end of maxima, you should select maxima from the menu of a display icon at the left side in middle bar.

    If you use maxima on gcl, there are no change. For maxima on clisp, you should change tm_maxima file. tm_maxima file is in /usr/libexec/TeXmacs-(version)/bin or /usr/local/libexec/TeXmacs-(version)/bin, where (version) is the version of TeXmacs such as 0.3.5.8. The followings are tm_maxima modified to use maxima on clisp.

    export TEXMACS_MAXIMA_PATH
    #exec maxima -load "$TEXMACS_MAXIMA_PATH/texmacs.lisp" | maxima_filter  
          
    export MAXIMA_DIRECTORY=/usr/local/maxima-5.6 
    export MAXIMA_DIRECTORY 
    exec /usr/lib/clisp/base/lisp.run -norc -M /usr/local/maxima-5.6/src/maxima-clisp.mem -i \
     "$TEXMACS_MAXIMA_PATH/texmacs.lisp" | maxima_filter
    		  

    maxima is replaced to lisp.run with -M and -i options. -M is used to specify a memory image. It is the same as clisp-maxima startup script. -i option is used to load the specified lisp file at the startup, this is replacement of -load option which is used in the original tm_maxima. If unchanged, there are no responces from maxima.

    There are problems in the LaTeX output of clisp-maxima. Those are the startup logo of clisp. In this startup logo, there are special characters such as "`", "'" and "\". These causes latex compile errors. To avoid these errors, replace these characters to "\x60","\x27" and "\\" each other. The following script is an example to execute these replacements.

    hoge, a script to replace the logo.

    #/bin/sh
    
    # USAGE:  hoge texmacs-output.tex > arranged.tex
    #
    
    cat $1 | awk 'BEGIN{n=0;F[1]="\\bgroup\\ttfamily";
    F[2]="\\begin{verbatim}";
    F[3]="  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo";
    F[4]="  I I I I I I I      8     8   8           8     8     o  8    8";
    F[5]="  I  \\ \x60+\x27 /  I      8         8           8     8        8    8";
    F[6]="   \\  \x60-+-\x27  /       8         8           8      ooooo   8oooo";
    F[7]="    \x60-__|__-\x27        8         8           8           8  8";
    F[8]="        |            8     o   8           8     o     8  8";
    F[9]="  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8";
    F[10]="\\end{verbatim}";}
    {n=n+1;if(n>27 || n<14){print $0}else{print F[n-13]}}'
    		  

index
ponpoko
Last modified: Wed May 26 09:34:28 JST 2004