|
@@ -1719,7 +1719,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Generate Match Test
|
|
#+Caption: Generate Match Test
|
|
-#+Name: gen-match-test
|
|
|
|
|
|
+#+Name: tex-gen-match-test
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defun generate-match-expression (op arity &optional (type '=))
|
|
(defun generate-match-expression (op arity &optional (type '=))
|
|
(declare (symbol op type)
|
|
(declare (symbol op type)
|
|
@@ -1743,7 +1743,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Define Matching Rule
|
|
#+Caption: Define Matching Rule
|
|
-#+Name: def-match-rule
|
|
|
|
|
|
+#+Name: tex-def-match-rule
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defmacro defrule (name (on arity &optional type) (&rest arguments) &body rule)
|
|
(defmacro defrule (name (on arity &optional type) (&rest arguments) &body rule)
|
|
(let ((match-expression (generate-match-expression on arity type))
|
|
(let ((match-expression (generate-match-expression on arity type))
|
|
@@ -1768,7 +1768,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Rule Storage
|
|
#+Caption: Rule Storage
|
|
-#+Name: rule-storage
|
|
|
|
|
|
+#+Name: tex-rule-storage
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defstruct (rule (:type list))
|
|
(defstruct (rule (:type list))
|
|
name test-function expansion-function)
|
|
name test-function expansion-function)
|
|
@@ -1783,7 +1783,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Retrieve Rule
|
|
#+Caption: Retrieve Rule
|
|
-#+Name: retrieve-rule
|
|
|
|
|
|
+#+Name: tex-retrieve-rule
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defun get-expansion (expression)
|
|
(defun get-expansion (expression)
|
|
(rule-expansion-function (rest
|
|
(rule-expansion-function (rest
|
|
@@ -1806,7 +1806,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Multiplication Rule
|
|
#+Caption: Multiplication Rule
|
|
-#+Name: multiplication-rule
|
|
|
|
|
|
+#+Name: tex-multiplication-rule
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule multiplication (* 2 >=) (&rest elements)
|
|
(defrule multiplication (* 2 >=) (&rest elements)
|
|
(format nil "{~{{~a}~^ \\cdot ~}}"
|
|
(format nil "{~{{~a}~^ \\cdot ~}}"
|
|
@@ -1822,7 +1822,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Division Rule
|
|
#+Caption: Division Rule
|
|
-#+Name: division-rule
|
|
|
|
|
|
+#+Name: tex-division-rule
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule division (/ 2 =) (a b)
|
|
(defrule division (/ 2 =) (a b)
|
|
(format nil "{\\frac{~a}{~a}}"
|
|
(format nil "{\\frac{~a}{~a}}"
|
|
@@ -1837,7 +1837,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Rule for addition
|
|
#+Caption: Rule for addition
|
|
-#+Name: addition-rule
|
|
|
|
|
|
+#+Name: tex-addition-rule
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule addition (+ 2 >=) (&rest elements)
|
|
(defrule addition (+ 2 >=) (&rest elements)
|
|
(format nil "{~{{~a}~^ + ~}}"
|
|
(format nil "{~{{~a}~^ + ~}}"
|
|
@@ -1853,7 +1853,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Subtraction Rule
|
|
#+Caption: Subtraction Rule
|
|
-#+Name: subtraction-rule
|
|
|
|
|
|
+#+Name: tex-subtraction-rule
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule subtraction (- 2 >=) (&rest elements)
|
|
(defrule subtraction (- 2 >=) (&rest elements)
|
|
(format nil "{~{{~a}~^ - ~}}"
|
|
(format nil "{~{{~a}~^ - ~}}"
|
|
@@ -1869,7 +1869,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Exponentials and Logarithms
|
|
#+Caption: Exponentials and Logarithms
|
|
-#+Name: exponentials-and-logarithms
|
|
|
|
|
|
+#+Name: tex-exponentials-and-logarithms
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule exp (exp 1 =) (expression)
|
|
(defrule exp (exp 1 =) (expression)
|
|
(format nil "{e^{~a}}"
|
|
(format nil "{e^{~a}}"
|
|
@@ -1897,7 +1897,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Trigonometric Functions
|
|
#+Caption: Trigonometric Functions
|
|
-#+Name: trigonometrics
|
|
|
|
|
|
+#+Name: tex-trigonometrics
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule sin (sin 1 =) (arg)
|
|
(defrule sin (sin 1 =) (arg)
|
|
(format nil "{\\sin {~a}}"
|
|
(format nil "{\\sin {~a}}"
|
|
@@ -1931,7 +1931,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Logic Rules
|
|
#+Caption: Logic Rules
|
|
-#+Name: logic-rules
|
|
|
|
|
|
+#+Name: tex-logic-rules
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule and (and 2 >=) (&rest elements)
|
|
(defrule and (and 2 >=) (&rest elements)
|
|
(format nil "{~{{~a}~^ \\wedge ~}}"
|
|
(format nil "{~{{~a}~^ \\wedge ~}}"
|
|
@@ -1956,7 +1956,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Equality Rules
|
|
#+Caption: Equality Rules
|
|
-#+Name: equality-rules
|
|
|
|
|
|
+#+Name: tex-equality-rules
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule = (= 2 =) (lhs rhs)
|
|
(defrule = (= 2 =) (lhs rhs)
|
|
(format nil "{{~a} = {~a}}"
|
|
(format nil "{{~a} = {~a}}"
|
|
@@ -1971,7 +1971,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Summation and Integration
|
|
#+Caption: Summation and Integration
|
|
-#+Name: summation-and-integration
|
|
|
|
|
|
+#+Name: tex-summation-and-integration
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule sum (sum 3 =) (start stop expression)
|
|
(defrule sum (sum 3 =) (start stop expression)
|
|
(format nil "{\\sum_{~a}^{~a} {~a}}"
|
|
(format nil "{\\sum_{~a}^{~a} {~a}}"
|
|
@@ -1994,7 +1994,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Specialty
|
|
#+Caption: Specialty
|
|
-#+Name: specialty
|
|
|
|
|
|
+#+Name: tex-specialty
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defrule parens (parens 2 =) (type inside)
|
|
(defrule parens (parens 2 =) (type inside)
|
|
(let* ((types '((square . ("[" . "]"))
|
|
(let* ((types '((square . ("[" . "]"))
|
|
@@ -2015,7 +2015,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Conversion Driver
|
|
#+Caption: Conversion Driver
|
|
-#+Name: conversion-driver
|
|
|
|
|
|
+#+Name: tex-conversion-driver
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defvar *tex-outputp* nil)
|
|
(defvar *tex-outputp* nil)
|
|
(declaim (special *tex-outputp*))
|
|
(declaim (special *tex-outputp*))
|
|
@@ -2056,7 +2056,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Misc Functions
|
|
#+Caption: Misc Functions
|
|
-#+Name: misc-functions
|
|
|
|
|
|
+#+Name: tex-misc-functions
|
|
#+BEGIN_SRC lisp
|
|
#+BEGIN_SRC lisp
|
|
(defun ensure-list (list)
|
|
(defun ensure-list (list)
|
|
(if (listp list)
|
|
(if (listp list)
|
|
@@ -2113,7 +2113,7 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
:END:
|
|
:END:
|
|
|
|
|
|
#+Caption: Packaging
|
|
#+Caption: Packaging
|
|
-#+Name: packaging
|
|
|
|
|
|
+#+Name: tex-packaging
|
|
#+BEGIN_SRC lisp :tangle "to-tex.lisp"
|
|
#+BEGIN_SRC lisp :tangle "to-tex.lisp"
|
|
;;;; to-tex.lisp
|
|
;;;; to-tex.lisp
|
|
;;;;
|
|
;;;;
|
|
@@ -2130,37 +2130,37 @@ The goal of this portion of the CAS is to produce \LaTeX{} formulae that can be
|
|
|
|
|
|
;;; "to-tex" goes here.
|
|
;;; "to-tex" goes here.
|
|
|
|
|
|
- <<misc-functions>>
|
|
|
|
|
|
+ <<tex-misc-functions>>
|
|
|
|
|
|
- <<rule-storage>>
|
|
|
|
|
|
+ <<tex-rule-storage>>
|
|
|
|
|
|
- <<gen-match-test>>
|
|
|
|
|
|
+ <<tex-gen-match-test>>
|
|
|
|
|
|
- <<def-match-rule>>
|
|
|
|
|
|
+ <<tex-def-match-rule>>
|
|
|
|
|
|
- <<retrieve-rule>>
|
|
|
|
|
|
+ <<tex-retrieve-rule>>
|
|
|
|
|
|
- <<conversion-driver>>
|
|
|
|
|
|
+ <<tex-conversion-driver>>
|
|
|
|
|
|
- <<addition-rule>>
|
|
|
|
|
|
+ <<tex-addition-rule>>
|
|
|
|
|
|
- <<subtraction-rule>>
|
|
|
|
|
|
+ <<tex-subtraction-rule>>
|
|
|
|
|
|
- <<multiplication-rule>>
|
|
|
|
|
|
+ <<tex-multiplication-rule>>
|
|
|
|
|
|
- <<division-rule>>
|
|
|
|
|
|
+ <<tex-division-rule>>
|
|
|
|
|
|
- <<exponentials-and-logarithms>>
|
|
|
|
|
|
+ <<tex-exponentials-and-logarithms>>
|
|
|
|
|
|
- <<trigonometrics>>
|
|
|
|
|
|
+ <<tex-trigonometrics>>
|
|
|
|
|
|
- <<logic-rules>>
|
|
|
|
|
|
+ <<tex-logic-rules>>
|
|
|
|
|
|
- <<equality-rules>>
|
|
|
|
|
|
+ <<tex-equality-rules>>
|
|
|
|
|
|
- <<summation-and-integration>>
|
|
|
|
|
|
+ <<tex-summation-and-integration>>
|
|
|
|
|
|
- <<specialty>>
|
|
|
|
|
|
+ <<tex-specialty>>
|
|
|
|
|
|
;;; End to-tex
|
|
;;; End to-tex
|
|
#+END_SRC
|
|
#+END_SRC
|