;; TeX-printing ;; (c) copyright 1987, Richard J. Fateman (in-package "MAXIMA") ;; Usage: tex(d8,"/tmp/foo.tex"); tex(d10,"/tmp/foo.tex"); .. ;; to append lines d8 and d10 to the tex file. If given only ;; one argument the result goes to standard output. ;; Extract from permission letter to wfs: ;; Date: Sat, 2 Apr 88 18:06:16 PST ;; From: fateman%vangogh.Berkeley.EDU@ucbvax.Berkeley.EDU (Richard Fateman) ;; To: wfs@rascal.ics.UTEXAS.EDU ;; Subject: about tex... ;; You have my permission to put it in NESC or give it to anyone ;; else who might be interested in it.... ;; source language: ;; There are changes by wfs to allow use inside MAXIMA which runs ;; in COMMON LISP. For original FRANZ LISP version contact rfw. ;; intended environment: vaxima (Vax or Sun). Parser should be ;; equivalent (in lbp/rbp data) to 1986 NESC Vaxima. ;;;(provide 'tex) ;;;(in-package 'tex) ;;;(export '($tex $texinit)) ;;;;; we'd like to just ;;;(import '(user::$bothcases user::lbp user::rbp user::nformat)) ;;;(use-package 'user) ;; March, 1987 ;; Method: ;; Producing TeX from a macsyma internal expression is done by ;; a reversal of the parsing process. Fundamentally, a ;; traversal of the expression tree is produced by the tex programs, ;; with appropriate substitutions and recognition of the ;; infix / prefix / postfix / matchfix relations on symbols. Various ;; changes are made to this so that TeX will like the results. ;; It is important to understand the binding powers of the operators ;; in Macsyma, in mathematics, and in TeX so that parentheses will ;; be inserted when necessary. Because TeX has different kinds of ;; groupings (e.g. in superscripts, within sqrts), not all ;; parentheses are explicitly need. ;; Instructions: ;; in macsyma, type tex(); or tex(