Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file: ;; http://anggtwu.net/MAXIMA/barematrix1.lisp.html ;; http://anggtwu.net/MAXIMA/barematrix1.lisp ;; (find-angg "MAXIMA/barematrix1.lisp") ;; Author: Eduardo Ochs <eduardoochs@gmail.com> ;; ;; This file is loaded by: ;; (find-angg "MAXIMA/barematrix1.mac") ;; It removes some TeX-isms from how "matrix"es and "/"s are TeXed, ;; and makes them more LaTeX-friendly. ;; ;; Compare the defuns below with: ;; (find-maximagitfile "src/mactex.lisp" "(defprop $matrix tex-matrix tex)") ;; (find-maximagitfile "src/mactex.lisp" "(defprop $matrix tex-matrix tex)" "\\ifx") ;; (find-maximagitfile "src/mactex.lisp" "(defun tex-mquotient ") ;; (find-maximagitfile "src/mactex.lisp" "(defun tex-mquotient " "\\over") ;; ;; (defun bl () (interactive) (find-angg "MAXIMA/barematrix1.lisp")) ;; (defun bm () (interactive) (find-angg "MAXIMA/barematrix1.mac")) ;; ;; «.tex-matrix» (to "tex-matrix") ;; «.tex-barematrix» (to "tex-barematrix") ;; «.tex-mquotient» (to "tex-mquotient") (defprop $matrix tex-matrix tex) (defprop $barematrix tex-barematrix tex) ;; «tex-matrix» (to ".tex-matrix") (defun tex-matrix (x l r) ;; matrix looks like ((mmatrix) ((mlist) a b) ...) (append l `("\\begin{pmatrix}") (mapcan #'(lambda(y) (tex-list (cdr y) nil (list "\\cr ") "&")) (cdr x)) '("\\end{pmatrix}") r)) ;; «tex-barematrix» (to ".tex-barematrix") ;; Bonus: (defun tex-barematrix (x l r) (append l `("\\begin{matrix}") (mapcan #'(lambda(y) (tex-list (cdr y) nil (list "\\cr ") "&")) (cdr x)) '("\\end{matrix}") r)) ;; «tex-mquotient» (to ".tex-mquotient") (defun tex-mquotient (x l r) (twoargcheck x) (setq l (tex (cadr x) (append l '("{\\frac{")) nil 'mparen 'mparen) ;the divide bar groups things r (tex (caddr x) (list "}{") (append '("}}")r) 'mparen 'mparen)) (append l r)) ;; Local Variables: ;; coding: utf-8-unix ;; End: