diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2005-02-04 06:20:52 +0000 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2005-02-04 06:20:52 +0000 |
commit | 7592e97042f083f5700778d88d153b2d12443699 (patch) | |
tree | 522244ab2d62fa6ca2b59bc10ccda99bbec2b5e7 /lisp/calc/calc-lang.el | |
parent | 96ff33d606fdc4e05432744ff9e257088dc7e3c4 (diff) | |
download | emacs-7592e97042f083f5700778d88d153b2d12443699.tar.gz emacs-7592e97042f083f5700778d88d153b2d12443699.tar.bz2 emacs-7592e97042f083f5700778d88d153b2d12443699.zip |
(math-latex-parse-frac): Don't use arguments.
(math-latex-parse-two-args): New function.
Diffstat (limited to 'lisp/calc/calc-lang.el')
-rw-r--r-- | lisp/calc/calc-lang.el | 29 |
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 @@ (put 'latex 'math-function-table (append (get 'tex 'math-function-table) - '(( \\frac . (math-latex-parse-frac /)) - ( \\tfrac . (math-latex-parse-frac /)) - ( \\dfrac . (math-latex-parse-frac /)) - ( \\binom . (math-latex-parse-frac calcFunc-choose)) - ( \\tbinom . (math-latex-parse-frac calcFunc-choose)) - ( \\dbinom . (math-latex-parse-frac calcFunc-choose)) + '(( \\frac . (math-latex-parse-frac)) + ( \\tfrac . (math-latex-parse-frac)) + ( \\dfrac . (math-latex-parse-frac)) + ( \\binom . (math-latex-parse-two-args calcFunc-choose)) + ( \\tbinom . (math-latex-parse-two-args calcFunc-choose)) + ( \\dbinom . (math-latex-parse-two-args calcFunc-choose)) ( \\phi . calcFunc-totient ) ( \\mu . calcFunc-moebius )))) @@ -487,12 +487,23 @@ (put 'latex 'math-complex-format 'i) + (defun math-latex-parse-frac (f val) (let (numer denom) - (setq args (math-read-expr-list)) + (setq numer (car (math-read-expr-list))) + (math-read-token) + (setq denom (math-read-factor)) + (if (and (Math-num-integerp numer) + (Math-num-integerp denom)) + (list 'frac numer denom) + (list '/ numer denom)))) + +(defun math-latex-parse-two-args (f val) + (let (first second) + (setq first (car (math-read-expr-list))) (math-read-token) - (setq margs (math-read-factor)) - (list (nth 2 f) (car args) margs))) + (setq second (math-read-factor)) + (list (nth 2 f) first second))) (defun math-latex-print-frac (a fn) (list 'horiz (nth 1 fn) "{" (math-compose-expr (nth 1 a) -1) |