mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 08:20:41 -08:00
(math-read-token): Read LaTeX matrices.
This commit is contained in:
parent
1be70c6150
commit
8d5cd17257
1 changed files with 16 additions and 2 deletions
|
|
@ -763,8 +763,22 @@ in Calc algebraic input.")
|
|||
((eq (nth 1 code) 'punc)
|
||||
(setq math-exp-token 'punc
|
||||
math-expr-data (nth 2 code)))
|
||||
((and (eq (nth 1 code) 'mat)
|
||||
(string-match " *{" math-exp-str math-exp-pos))
|
||||
((and (eq (nth 1 code) 'begenv)
|
||||
(string-match " *{\\([^}]*\\)}" math-exp-str math-exp-pos))
|
||||
(setq math-exp-pos (match-end 0)
|
||||
envname (match-string 1 math-exp-str)
|
||||
math-exp-token 'punc
|
||||
math-expr-data "[")
|
||||
(cond ((or (string= envname "matrix")
|
||||
(string= envname "bmatrix")
|
||||
(string= envname "pmatrix"))
|
||||
(if (setq j (string-match (concat "\\\\end{" envname "}")
|
||||
math-exp-str math-exp-pos))
|
||||
(setq math-exp-str
|
||||
(replace-match "]" t t math-exp-str))
|
||||
(error "%s" (concat "No closing \\end{" envname "}"))))))
|
||||
((and (eq (nth 1 code) 'mat)
|
||||
(string-match " *{" math-exp-str math-exp-pos))
|
||||
(setq math-exp-pos (match-end 0)
|
||||
math-exp-token 'punc
|
||||
math-expr-data "[")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue