/[emacs]/emacs/lisp/calc/calc-lang.el
ViewVC logotype

Diff of /emacs/lisp/calc/calc-lang.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by jpb, Mon Jan 31 21:53:21 2005 UTC revision 1.15 by jpb, Fri Feb 4 06:20:52 2005 UTC
# Line 469  Line 469 
469  (put 'latex 'math-function-table  (put 'latex 'math-function-table
470       (append       (append
471        (get 'tex 'math-function-table)        (get 'tex 'math-function-table)
472        '(( \\frac      . (math-latex-parse-frac /))        '(( \\frac      . (math-latex-parse-frac))
473          ( \\tfrac     . (math-latex-parse-frac /))          ( \\tfrac     . (math-latex-parse-frac))
474          ( \\dfrac     . (math-latex-parse-frac /))          ( \\dfrac     . (math-latex-parse-frac))
475          ( \\binom     . (math-latex-parse-frac calcFunc-choose))          ( \\binom     . (math-latex-parse-two-args calcFunc-choose))
476          ( \\tbinom    . (math-latex-parse-frac calcFunc-choose))          ( \\tbinom    . (math-latex-parse-two-args calcFunc-choose))
477          ( \\dbinom    . (math-latex-parse-frac calcFunc-choose))          ( \\dbinom    . (math-latex-parse-two-args calcFunc-choose))
478          ( \\phi       . calcFunc-totient )          ( \\phi       . calcFunc-totient )
479          ( \\mu        . calcFunc-moebius ))))          ( \\mu        . calcFunc-moebius ))))
480    
# Line 487  Line 487 
487    
488  (put 'latex 'math-complex-format 'i)  (put 'latex 'math-complex-format 'i)
489    
490    
491  (defun math-latex-parse-frac (f val)  (defun math-latex-parse-frac (f val)
492    (let (numer denom)    (let (numer denom)
493      (setq args (math-read-expr-list))      (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)))
504      (math-read-token)      (math-read-token)
505      (setq margs (math-read-factor))      (setq second (math-read-factor))
506      (list (nth 2 f) (car args) margs)))      (list (nth 2 f) first second)))
507    
508  (defun math-latex-print-frac (a fn)  (defun math-latex-print-frac (a fn)
509    (list 'horiz (nth 1 fn) "{" (math-compose-expr (nth 1 a) -1)    (list 'horiz (nth 1 fn) "{" (math-compose-expr (nth 1 a) -1)

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26