updated specfun, mactex, and ...
- Subject: updated specfun, mactex, and ...
- From: Andrey G. Grozin
- Date: Sat, 22 Dec 2001 15:40:37 +0600
Merry Christmas and Happy New Year to *,
On Mon, 10 Dec 2001 willisb@unk.edu wrote:
> 1. mactex-1.7.lisp --- I collected all the additions and fixes
> I know of for mactex. I suggest that mactex-1.7.lisp replace the
> version that Maxima currently uses.
Here are some small additions to mactex.lisp which I find useful. If
nobody has objections, they should be, probably, included.
Andrey
--- mactex-1.7.lisp Sat Dec 15 16:30:27 2001
+++ mactex.lisp Sat Dec 22 16:35:31 2001
@@ -193,11 +193,20 @@
(append l
(list (cond ((numberp x) (texnumformat x))
((and (symbolp x) (get x 'texword)))
+ ((stringp x) (texstring x))
+ ((characterp x) (texchar x))
(t (tex-stripdollar x))))
r))
-
+(defun texstring (x)
+ (cond ((equal x "") "")
+ ((eql (elt x 0) #\\) x)
+ (t (concatenate 'string "\\mbox{{}" x "{}}"))))
+
+(defun texchar (x)
+ (if (eql x #\|) "\\mbox{\\verb/|/}"
+ (concatenate 'string "\\mbox{\\verb|" (string x) "|}")))
(defvar *tex-translations* nil)
;; '(("AB" . "a")("X" . "x")) would cause AB12 and X3 C4 to print a_{12} and x_3 C_4
@@ -382,6 +391,7 @@
(defprop $beta "\\beta" texword)
(defprop $gamma "\\gamma" texword)
(defprop %gamma "\\Gamma" texword)
+(defprop $%gamma "\\gamma" texword)
(defprop $delta "\\delta" texword)
(defprop $epsilon "\\varepsilon" texword)
(defprop $zeta "\\zeta" texword)
@@ -544,6 +554,7 @@
;; TeX is lots more flexible .. but
(defprop %sum tex-sum tex)
+(defprop %lsum tex-lsum tex)
(defprop %product tex-sum tex)
;; easily extended to union, intersect, otherops
@@ -560,6 +571,16 @@
(toplim (tex (car(cddddr x)) nil nil 'mparen 'mparen)))
(append l `( ,op ,@index "}^{" ,@toplim "}{" ,@s1 "}") r)))
+(defun tex-lsum(x l r)
+ (let ((op (cond ((eq (caar x) '%lsum) "\\sum_{")
+ ;; extend here
+ ))
+ ;; gotta be one of those above
+ (s1 (tex (cadr x) nil nil 'mparen rop));; summand
+ (index ;; "index = lowerlimit"
+ (tex `((min simp) , (caddr x), (cadddr x)) nil nil 'mparen 'mparen)))
+ (append l `( ,op ,@index "}}{" ,@s1 "}") r)))
+
(defprop %integrate tex-int tex)
(defun tex-int (x l r)
(let ((s1 (tex (cadr x) nil nil 'mparen 'mparen));;integrand delims / & d
@@ -643,6 +664,11 @@
(defprop mminus 100. tex-rbp)
(defprop mminus 100. tex-lbp)
+(defprop min tex-infix tex)
+(defprop min ("\\in{") texsym)
+(defprop min 80. tex-lbp)
+(defprop min 80. tex-rbp)
+
(defprop mequal tex-infix tex)
(defprop mequal (=) texsym)
(defprop mequal 80. tex-lbp)
@@ -821,6 +847,24 @@
(t `("\\mathbf{unless}" ,(seventh x))))
`("\\mathbf{do}" ,(eighth x))))
+(defprop mtext tex-mtext tex)
+(defprop text-string tex-mtext tex)
+(defprop mlable tex-mlable tex)
+(defprop spaceout tex-spaceout tex)
+
+(defun tex-mtext (x l r) (tex-list (cdr x) l r ""))
+
+(defun tex-mlable (x l r)
+ (tex (caddr x)
+ (append l
+ (if (cadr x)
+ (list (format nil "\\mbox{\\tt(~A) }" (stripdollar (cadr x))))
+ nil))
+ r 'mparen 'mparen))
+
+(defun tex-spaceout (x l r)
+ (append l (list "\\mbox{\\verb|" (make-string (cadr x) :initial-element #\space) "|}") r))
+
;; initialize a file so that c-lines will look ok in verbatim mode
;; run this first before tex(<whatever>, file);
(defun $texinit(file)