aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2005-02-04 06:20:52 +0000
committerJay Belanger2005-02-04 06:20:52 +0000
commit7592e97042f083f5700778d88d153b2d12443699 (patch)
tree522244ab2d62fa6ca2b59bc10ccda99bbec2b5e7
parent96ff33d606fdc4e05432744ff9e257088dc7e3c4 (diff)
downloademacs-7592e97042f083f5700778d88d153b2d12443699.tar.gz
emacs-7592e97042f083f5700778d88d153b2d12443699.zip
(math-latex-parse-frac): Don't use arguments.
(math-latex-parse-two-args): New function.
-rw-r--r--lisp/calc/calc-lang.el29
1 files changed, 20 insertions, 9 deletions
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el
index d91d78fc461..63d24bb76d5 100644
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
@@ -469,12 +469,12 @@
469(put 'latex 'math-function-table 469(put 'latex 'math-function-table
470 (append 470 (append
471 (get 'tex 'math-function-table) 471 (get 'tex 'math-function-table)
472 '(( \\frac . (math-latex-parse-frac /)) 472 '(( \\frac . (math-latex-parse-frac))
473 ( \\tfrac . (math-latex-parse-frac /)) 473 ( \\tfrac . (math-latex-parse-frac))
474 ( \\dfrac . (math-latex-parse-frac /)) 474 ( \\dfrac . (math-latex-parse-frac))
475 ( \\binom . (math-latex-parse-frac calcFunc-choose)) 475 ( \\binom . (math-latex-parse-two-args calcFunc-choose))
476 ( \\tbinom . (math-latex-parse-frac calcFunc-choose)) 476 ( \\tbinom . (math-latex-parse-two-args calcFunc-choose))
477 ( \\dbinom . (math-latex-parse-frac calcFunc-choose)) 477 ( \\dbinom . (math-latex-parse-two-args calcFunc-choose))
478 ( \\phi . calcFunc-totient ) 478 ( \\phi . calcFunc-totient )
479 ( \\mu . calcFunc-moebius )))) 479 ( \\mu . calcFunc-moebius ))))
480 480
@@ -487,12 +487,23 @@
487 487
488(put 'latex 'math-complex-format 'i) 488(put 'latex 'math-complex-format 'i)
489 489
490
490(defun math-latex-parse-frac (f val) 491(defun math-latex-parse-frac (f val)
491 (let (numer denom) 492 (let (numer denom)
492 (setq args (math-read-expr-list)) 493 (setq numer (car (math-read-expr-list)))
494 (math-read-token)
495 (setq denom (math-read-factor))
496 (if (and (Math-num-integerp numer)
497 (Math-num-integerp denom))
498 (list 'frac numer denom)
499 (list '/ numer denom))))
500
501(defun math-latex-parse-two-args (f val)
502 (let (first second)
503 (setq first (car (math-read-expr-list)))
493 (math-read-token) 504 (math-read-token)
494 (setq margs (math-read-factor)) 505 (setq second (math-read-factor))
495 (list (nth 2 f) (car args) margs))) 506 (list (nth 2 f) first second)))
496 507
497(defun math-latex-print-frac (a fn) 508(defun math-latex-print-frac (a fn)
498 (list 'horiz (nth 1 fn) "{" (math-compose-expr (nth 1 a) -1) 509 (list 'horiz (nth 1 fn) "{" (math-compose-expr (nth 1 a) -1)