diff options
| author | Jay Belanger | 2005-01-31 09:05:27 +0000 |
|---|---|---|
| committer | Jay Belanger | 2005-01-31 09:05:27 +0000 |
| commit | 8d5cd17257e20550ff1d77a8fc682d3359d8f0d2 (patch) | |
| tree | 0decf384f2867fcb59c85821d2f7088e29f3a417 | |
| parent | 1be70c6150ce8a16ad0526d6948bac42aeb99308 (diff) | |
| download | emacs-8d5cd17257e20550ff1d77a8fc682d3359d8f0d2.tar.gz emacs-8d5cd17257e20550ff1d77a8fc682d3359d8f0d2.zip | |
(math-read-token): Read LaTeX matrices.
| -rw-r--r-- | lisp/calc/calc-aent.el | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index bf4f5c382e7..49aae82a950 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -763,8 +763,22 @@ in Calc algebraic input.") | |||
| 763 | ((eq (nth 1 code) 'punc) | 763 | ((eq (nth 1 code) 'punc) |
| 764 | (setq math-exp-token 'punc | 764 | (setq math-exp-token 'punc |
| 765 | math-expr-data (nth 2 code))) | 765 | math-expr-data (nth 2 code))) |
| 766 | ((and (eq (nth 1 code) 'mat) | 766 | ((and (eq (nth 1 code) 'begenv) |
| 767 | (string-match " *{" math-exp-str math-exp-pos)) | 767 | (string-match " *{\\([^}]*\\)}" math-exp-str math-exp-pos)) |
| 768 | (setq math-exp-pos (match-end 0) | ||
| 769 | envname (match-string 1 math-exp-str) | ||
| 770 | math-exp-token 'punc | ||
| 771 | math-expr-data "[") | ||
| 772 | (cond ((or (string= envname "matrix") | ||
| 773 | (string= envname "bmatrix") | ||
| 774 | (string= envname "pmatrix")) | ||
| 775 | (if (setq j (string-match (concat "\\\\end{" envname "}") | ||
| 776 | math-exp-str math-exp-pos)) | ||
| 777 | (setq math-exp-str | ||
| 778 | (replace-match "]" t t math-exp-str)) | ||
| 779 | (error "%s" (concat "No closing \\end{" envname "}")))))) | ||
| 780 | ((and (eq (nth 1 code) 'mat) | ||
| 781 | (string-match " *{" math-exp-str math-exp-pos)) | ||
| 768 | (setq math-exp-pos (match-end 0) | 782 | (setq math-exp-pos (match-end 0) |
| 769 | math-exp-token 'punc | 783 | math-exp-token 'punc |
| 770 | math-expr-data "[") | 784 | math-expr-data "[") |