axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Patches for Maxima on DoyenCD


From: Page, Bill
Subject: [Axiom-developer] Patches for Maxima on DoyenCD
Date: Tue, 3 Oct 2006 02:55:31 -0400

Alfredo, 

On Monday, October 02, 2006 11:50 PM I wrote:
> 
> > 
> > > Also, did you get my email for last week reguarding a
> > > problem with Maxima output on the version of DoyenCD at
> > > http://doyen.sytes.net ?
> > 
> > I do not know what to do about this...should I use another 
> > version of Maxima or should I try to fix the regex that
> > controls this?
> > 
> 
> I took a look at this. I think it is due to a difference between
> the Clisp and GCL versions of lisp used to compile Maxima. (Clisp
> used on DoyenCD but GCL used on MathAction). In particular the
> removal of the $ is supposed to take place in the special Lisp
> code called 'mathaction-maxima-5.9.3.lisp' that is added to
> Maxima when it is called in 'maximaWrapper.py'. This is a modified
> version of the same Lisp code that is used to interface with
> TeXmacs. But this code does not seem correct for the character
> sequence generated by the Clisp version of Maxima. I can correct
> this but I also have to change the regex in ReplaceInlineMaxima
> so that it correctly indentifies input and output sections.
> 
> I will send you the modifications later tonight.
> 

Here are the patches:

address@hidden LatexWiki]# cd ~
address@hidden ~]# cd /var/lib/zope/Products/LatexWiki

The first one is a correction to the Maxima Lisp interface code.
Under GCL these extra \ $ characters are not generated so this
code was none functional. But it is required to correct the weird
behaviour of Maxima under Clisp.

address@hidden LatexWiki]# diff -au mathaction-maxima-5.9.3.lisp_orig
mathaction-maxima-5.9.3.lisp
--- mathaction-maxima-5.9.3.lisp_orig   2006-10-03 02:21:18.134961500
-0400
+++ mathaction-maxima-5.9.3.lisp        2006-10-03 02:03:24.087837750
-0400
@@ -36,7 +36,7 @@
 (defun tex-stripdollar (sym)
   (or (symbolp sym) (return-from tex-stripdollar sym))
   (let* ((name (quote-% (print-invert-case sym)))
-      (name1 (if (memq (elt name 0) '(#\$ #\&)) (subseq name 1) name))
+      (name1 (if (memq (elt name 0) '(#\\ #\$)) (subseq name 2) name))
       (l (length name1)))
     (if (eql l 1) name1 (concatenate 'string "\\mathrm{" name1 "}"))))

The second one is required because of the first patch since the extra
\ $ is now eliminated. (That makes ReplaceInlineMaxima.py identical to
the version on MathAction.)

address@hidden LatexWiki]# diff -au ReplaceInlineMaxima.py
ReplaceInlineMaxima.py_orig
--- ReplaceInlineMaxima.py_orig      2006-10-03 02:19:27.952075500 -0400
+++ ReplaceInlineMaxima.py           2006-10-03 02:05:50.012957500 -0400
@@ -21,8 +21,8 @@
         reConsts)
     maximaOutPattern = re.compile(
         #r'<latex>.*?black\}(.*?)</latex>'              #1 LaTeX
-        r'<latex>\\mbox{\\tt\\red\(\\\$\\mathrm{\\%(i\d+)}\)
\\black}(.*?)</latex>|'   #1 #2 Input
-        r'<latex>\\mbox{\\tt\\red\(\\\$\\mathrm{\\%(o\d+)}\)
\\black}(.*?)</latex>|'   #3 #4 Output
+        r'<latex>\\mbox{\\tt\\red\(\\mathrm{\\%(i\d+)}\)
\\black}(.*?)</latex>|'   #1 #2 Input
+        r'<latex>\\mbox{\\tt\\red\(\\mathrm{\\%(o\d+)}\)
\\black}(.*?)</latex>|'   #3 #4 Output
         r'stdin:((?:.(?!<latex>))*.)',  #5 Other stuff
         reConsts)

address@hidden LatexWiki]#

Let me know if you have any trouble with these changes.

Regards,
Bill Page.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]