;; TeX-printing ;; (c) copyright 1987, Richard J. Fateman ;; This is experimental code and not to be distributed without express ;; permission of the author. ;; source language: Franz Lisp. ;; 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(