|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file:
;; http://anggtwu.net/myqdraw/myqdraw-tex.lisp.html
;; http://anggtwu.net/myqdraw/myqdraw-tex.lisp
;; (find-angg "myqdraw/myqdraw-tex.lisp")
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Version: 2025dec26
;; Public domain.
;;
;; This file is loaded by:
;; (find-myqdraw "myqdraw3.mac")
;; It removes some TeX-isms from how "matrix"es and "/"s are TeXed,
;; and makes them more LaTeX-friendly.
;;
;; «.quotient-and-matrix» (to "quotient-and-matrix")
;; «.includegraphics» (to "includegraphics")
;; «quotient-and-matrix» (to ".quotient-and-matrix")
;; Copied from:
;; (find-angg "MAXIMA/2025-displa-tex.lisp" "quotient")
;; (find-angg "MAXIMA/2025-displa-tex.lisp" "matrix")
;;
;; Here we just redefine `tex-mquotient' and `tex-matrix' to remove
;; some TeXisms and to make them use pure LaTeX - we don't need to run
;; their `defprop's again.
;;
(defun tex-mquotient (x l r)
(twoargcheck x)
(setq l (tex (cadr x) (append l '("{\\frac{")) nil 'mparen 'mparen)
r (tex (caddr x) (list "}{") (append '("}}") r) 'mparen 'mparen))
(append l r))
(defun tex-matrix (x l r)
(append l `("\\begin{pmatrix}")
(mapcan #'(lambda (y)
(tex-list (cdr y) nil (list "\\cr ") "&"))
(cdr x))
'("\\end{pmatrix}") r))
;; «includegraphics» (to ".includegraphics")
;; `includegraphics' is new - it needs a `defprop'.
;;
(defprop $includegraphics tex-includegraphics tex)
(defun tex-includegraphics (x l r)
`(,@l ,(format nil "\\myvcenter{\\includegraphics[~a]{~a}}" (cadr x) (caddr x)) ,@r))
#|
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("myqdraw-tex.lisp");
ig : includegraphics("height=5cm", "foo_bar.pdf");
tex1(ig);
M : matrix([2,3],[4,5]);
tex1(M);
|#