Mercurial > emacs
comparison lisp/calc/calc-lang.el @ 101129:25d50d869d34
(math-compose-tex-sqrt): New function (previously commented out).
(math-special-function-table): Use `math-compose-tex-sqrt' to compose
sqrts in TeX and LaTeX mode.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Sun, 11 Jan 2009 19:13:15 +0000 |
parents | a9dc0e7c3f2b |
children | 1d1d5d9bd884 |
comparison
equal
deleted
inserted
replaced
101128:311f898c790b | 101129:25d50d869d34 |
---|---|
492 ( \\mu . calcFunc-moebius ))) | 492 ( \\mu . calcFunc-moebius ))) |
493 | 493 |
494 (put 'tex 'math-special-function-table | 494 (put 'tex 'math-special-function-table |
495 '((calcFunc-sum . (math-compose-tex-sum "\\sum")) | 495 '((calcFunc-sum . (math-compose-tex-sum "\\sum")) |
496 (calcFunc-prod . (math-compose-tex-sum "\\prod")) | 496 (calcFunc-prod . (math-compose-tex-sum "\\prod")) |
497 (calcFunc-sqrt . math-compose-tex-sqrt) | |
497 (intv . math-compose-tex-intv))) | 498 (intv . math-compose-tex-intv))) |
498 | 499 |
499 (put 'tex 'math-variable-table | 500 (put 'tex 'math-variable-table |
500 '( | 501 '( |
501 ;; The Greek letters | 502 ;; The Greek letters |
671 (while (string-match "[0-9]\\\\,[0-9]" str) | 672 (while (string-match "[0-9]\\\\,[0-9]" str) |
672 (setq str (concat (substring str 0 (1+ (match-beginning 0))) | 673 (setq str (concat (substring str 0 (1+ (match-beginning 0))) |
673 (substring str (1- (match-end 0)))))) | 674 (substring str (1- (match-end 0)))))) |
674 str) | 675 str) |
675 | 676 |
676 ;(defun math-tex-print-sqrt (a) | 677 (defun math-compose-tex-sqrt (a) |
677 ; (list 'horiz | 678 (list 'horiz |
678 ; "\\sqrt{" | 679 "\\sqrt{" |
679 ; (math-compose-expr (nth 1 a) 0) | 680 (math-compose-expr (nth 1 a) 0) |
680 ; "}")) | 681 "}")) |
681 | 682 |
682 (defun math-compose-tex-intv (a) | 683 (defun math-compose-tex-intv (a) |
683 (list 'horiz | 684 (list 'horiz |
684 (if (memq (nth 1 a) '(0 1)) "(" "[") | 685 (if (memq (nth 1 a) '(0 1)) "(" "[") |
685 (math-compose-expr (nth 2 a) 0) | 686 (math-compose-expr (nth 2 a) 0) |
780 (put 'latex 'math-special-function-table | 781 (put 'latex 'math-special-function-table |
781 '((/ . (math-compose-latex-frac "\\frac")) | 782 '((/ . (math-compose-latex-frac "\\frac")) |
782 (calcFunc-choose . (math-compose-latex-frac "\\binom")) | 783 (calcFunc-choose . (math-compose-latex-frac "\\binom")) |
783 (calcFunc-sum . (math-compose-tex-sum "\\sum")) | 784 (calcFunc-sum . (math-compose-tex-sum "\\sum")) |
784 (calcFunc-prod . (math-compose-tex-sum "\\prod")) | 785 (calcFunc-prod . (math-compose-tex-sum "\\prod")) |
786 (calcFunc-sqrt . math-compose-tex-sqrt) | |
785 (intv . math-compose-tex-intv))) | 787 (intv . math-compose-tex-intv))) |
786 | 788 |
787 (put 'latex 'math-variable-table | 789 (put 'latex 'math-variable-table |
788 (get 'tex 'math-variable-table)) | 790 (get 'tex 'math-variable-table)) |
789 | 791 |