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 |
|
|
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) |