Initial Commit
[packages] / xemacs-packages / auctex / style / unicode-math.el
1 ;;; unicode-math.el --- AUCTeX style for `unicode-math.sty' version 0.7e.
2
3 ;; Copyright (C) 2013 Free Software Foundation, Inc.
4
5 ;; Maintainer: auctex-devel@gnu.org
6 ;; Author: Mosè Giordano <giordano.mose@libero.it>
7 ;; Keywords: tex
8
9 ;; This file is part of AUCTeX.
10
11 ;; AUCTeX is free software; you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 3, or (at your option)
14 ;; any later version.
15
16 ;; AUCTeX is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
23 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 ;; 02110-1301, USA.
25
26 ;;; Commentary:
27
28 ;; This file adds support for `unicode-math.sty' version 0.7e.
29
30 ;;; Code:
31
32 (defvar LaTeX-unicode-math-package-options-list
33   '(("math-style" ("ISO" "TeX" "french" "upright" "literal"))
34     ("bold-style" ("ISO" "TeX" "upright" "literal"))
35     ("sans-style" ("italic" "upright" "literal"))
36     ("nabla" ("italic" "upright" "literal"))
37     ("partial" ("upright" "italic" "literal"))
38     ("vargreek-shape" ("unicode" "TeX"))
39     ("colon" ("literal" "TeX"))
40     ("slash-delimiter" ("ascii" "frac" "div")))
41   "Package options for the unicode-math package.")
42
43 (defvar LaTeX-unicode-math-setmathfont-options
44   (append LaTeX-unicode-math-package-options-list
45           '(("range")
46             ("script-font")
47             ("script-features")
48             ("sscript-font")
49             ("sscript-features")))
50   "Options for the setmathfont macro of the unicode-math package.")
51
52 (TeX-add-style-hook
53  "unicode-math"
54  (lambda ()
55    (TeX-run-style-hooks "ifxetex" "ifluatex" "expl3" "xparse" "l3keys2e"
56                         "fontspec" "catchfile" "fix-cm" "filehook")
57    (TeX-add-symbols
58     '("setmathfont" [TeX-arg-key-val LaTeX-unicode-math-setmathfont-options]
59       "Math font name")
60     '("unimathsetup" (TeX-arg-key-val LaTeX-unicode-math-package-options-list)))
61
62    ;; Fontification
63    (when (and (featurep 'font-latex)
64               (eq TeX-install-font-lock 'font-latex-setup))
65      (font-latex-add-keywords '(("setmathfont" "[{")
66                                 ("unimathsetup" "{"))
67                               'function)))
68  LaTeX-dialect)
69
70 (defun LaTeX-unicode-math-package-options ()
71   "Prompt for package options for the unicode-math package."
72   (TeX-read-key-val t LaTeX-unicode-math-package-options-list))
73
74 ;;; unicode-math.el ends here