monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 8908e1f1eb1a7d25d5179f5b133e798039ca9bd7
Author: Ralf Angeli <[email protected]>
Date: Sun Jan 6 17:37:21 2013 +0000
* style/mathtools.el ("mathtools"): Append amsmath options to
mathtools option after the amsmath style file has been loaded.
Remove `function' wrapper.
---
ChangeLog | 6 ++
style/mathtools.el | 229 ++++++++++++++++++++++++++--------------------------
2 files changed, 122 insertions(+), 113 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ea8c45c..c1250eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-06 Ralf Angeli <[email protected]>
+
+ * style/mathtools.el ("mathtools"): Append amsmath options to
+ mathtools option after the amsmath style file has been loaded.
+ Remove `function' wrapper.
+
2013-01-05 Ralf Angeli <[email protected]>
* Makefile.in (STYLESRC): Activate new style files.
diff --git a/style/mathtools.el b/style/mathtools.el
index 082d7e1..102e25d 100644
--- a/style/mathtools.el
+++ b/style/mathtools.el
@@ -36,6 +36,12 @@
;;; Code:
+;; amsmath options which can be passed directly to mathtools are
+;; appended in the style hook below
+(defvar LaTeX-mathtools-package-options
+ '("fixamsmath" "donotfixamsmathbugs" "allowspaces" "disallowspaces")
+ "Package options for the mathtools package.")
+
(defvar LaTeX-mathtools-key-val-options
"Options for the \\mathtoolsset command"
'(("showonlyrefs")
@@ -52,113 +58,116 @@
(TeX-add-style-hook
"mathtools"
- (function
- (lambda ()
-
- ;; mathtools requires amsmath, as some bugs in amsmath are fixed
- (TeX-run-style-hooks "amsmath")
-
- (LaTeX-add-environments
- '("lgathered" LaTeX-amsmath-env-aligned)
- '("rgathered" LaTeX-amsmath-env-aligned)
- '("multlined" LaTeX-mathtools-env-multlined)
- '("matrix*" LaTeX-mathtools-env-matrix-starred)
- '("pmatrix*" LaTeX-mathtools-env-matrix-starred)
- '("bmatrix*" LaTeX-mathtools-env-matrix-starred)
- '("Bmatrix*" LaTeX-mathtools-env-matrix-starred)
- '("vmatrix*" LaTeX-mathtools-env-matrix-starred)
- '("Vmatrix*" LaTeX-mathtools-env-matrix-starred)
- '("spreadlines" LaTeX-mathtools-env-spreadlines)
- "dcases" "dcases*")
-
- (TeX-add-symbols
- '("mathtoolsset" (TeX-arg-key-val LaTeX-mathtools-key-val))
- '("mathclap" 1)
- '("mathllap" ["Mathstyle"] t)
- '("mathrlap" ["Mathstyle"] t)
- '("mathclap" ["Mathstyle"] t)
- '("mathmakebox" [TeX-arg-size] [ TeX-arg-size ] 1)
- '("clap" 1)
- '("mathmbox" 1)
- '("cramped" 1)
- '("crampedllap" [ "Mathstye" ] t)
- '("crampedrlap" [ "Mathstyle" ] t)
- '("crampedclap" [ "Mathstyle" ] t)
- '("smashoperator" [ "Position (l, r or lr (default)" ] 2)
- ;; 3.1.4 Adjusting the limits of operators
- ;; explicit argument encapsulation does not seem to be required
- '("adjustlimits" 4)
- ;; 3.2 Controlling tags
- '("newtagform" "Name" ["Inner format"] "Left" "Right")
- '("renewtagform" "Name" ["Inner format"] "Left" "Right")
- '("usetagform" "Name")
- '("xleftrightarrow" ["Below"] "Above")
- '("xLeftarrow" ["Below"] "Above")
- '("xRightarrow" ["Below"] "Above")
- '("xLeftrightarrow" ["Below"] "Above")
- '("xhookleftarrow" ["Below"] "Above")
- '("xhookrightarrow" ["Below"] "Above")
- '("xmapsto" ["Below"] "Above")
- '("xrightharpoondown" ["Below"] "Above")
- '("xrightharpoonup" ["Below"] "Above")
- '("xleftharpoondown" ["Below"] "Above")
- '("xleftharpoonup" ["Below"] "Above")
- '("xrightleftharpoons" ["Below"] "Above")
- '("xleftrightharpoons" ["Below"] "Above")
- '("underbracket" [ "Rule thickness" ] [ "Bracket height" ] t)
- '("overbracket" [ "Rule thickness" ] [ "Bracket height" ] t)
- '("underbrace" 1)
- '("overbrace" 1)
- '("LaTeXunderbrace" 1)
- '("LaTeXoverbrace" 1)
- ;; 3.4.2
- '("shoveleft" [ TeX-arg-size ] 1)
- '("shoveright" [ TeX-arg-size ] 1)
- ;; don't understand t, but intertext in amsmath.el uses it
- '("shortintertext" t)
- '("DeclarePairedDelimeter" TeX-arg-macro "Left delimeter" "Right
delimeter")
- ;; 3.4.4
- '("MoveEqLeft" [ "Number" ])
- '("ArrowBetweenLines" [ TeX-arg-macro ] )
- '("ArrowBetweenLines*" [ TeX-arg-macro ] )
- ;; colon operators
- "vcentcolon" "ordinarycolon" "coloneqq" "Coloneqq"
- "coloneq" "Coloneq" "eqqcolon" "Eqqcolon" "eqcolon"
- "Eqcolon" "colonapprox" "Colonapprox" "colonsim" "Colonsim"
- ;; 3.7.1
- "lparen" "rparen"
- ;; left sub/superscripts
- '("prescript" "Below" "Above" t)
- ;; Declaring math sizes; this command doesn't seem so relevant, but
- ;; for completion, it's included
- '("DeclareMathSizes" 4)
- ;; Gathered envionments
- '("newgather" "Name" "Pre-line" "Post-line" "After")
- '("renewgather" "Name" "Pre-line" "Post-line" "After")
- ;; Split fractions
- '("splitfrac" 2)
- '("splitdfrac" 2))
-
- (setq LaTeX-item-list
- (append '(("multlined" . LaTeX-item-equation)
- ("lgathered" . LaTeX-item-equation)
- ("rgathered" . LaTeX-item-equation)
- ("spreadlines" . LaTeX-item-equation)
- ("matrix*" . LaTeX-item-equation)
- ("pmatrix*" . LaTeX-item-equation)
- ("bmatrix*" . LaTeX-item-equation)
- ("Bmatrix*" . LaTeX-item-equation)
- ("vmatrix*" . LaTeX-item-equation)
- ("Vmatrix*" . LaTeX-item-equation)
- ("dcases" . LaTeX-item-equation)
- ("dcases*" . LaTeX-item-equation))
- LaTeX-item-list))
-
- (setq LaTeX-label-alist
- (append '(("lgathered" . LaTeX-amsmath-label)
- ("rgathered" . LaTeX-amsmath-label)
- ("multlined" . LaTeX-amsmath-label)
- LaTeX-label-alist))))))
+ (lambda ()
+
+ ;; mathtools requires amsmath, as some bugs in amsmath are fixed
+ (TeX-run-style-hooks "amsmath")
+
+ (setq LaTeX-mathtools-package-options
+ (append LaTeX-mathtools-package-options
+ LaTeX-amsmath-package-options))
+
+ (LaTeX-add-environments
+ '("lgathered" LaTeX-amsmath-env-aligned)
+ '("rgathered" LaTeX-amsmath-env-aligned)
+ '("multlined" LaTeX-mathtools-env-multlined)
+ '("matrix*" LaTeX-mathtools-env-matrix-starred)
+ '("pmatrix*" LaTeX-mathtools-env-matrix-starred)
+ '("bmatrix*" LaTeX-mathtools-env-matrix-starred)
+ '("Bmatrix*" LaTeX-mathtools-env-matrix-starred)
+ '("vmatrix*" LaTeX-mathtools-env-matrix-starred)
+ '("Vmatrix*" LaTeX-mathtools-env-matrix-starred)
+ '("spreadlines" LaTeX-mathtools-env-spreadlines)
+ "dcases" "dcases*")
+
+ (TeX-add-symbols
+ '("mathtoolsset" (TeX-arg-key-val LaTeX-mathtools-key-val))
+ '("mathclap" 1)
+ '("mathllap" ["Mathstyle"] t)
+ '("mathrlap" ["Mathstyle"] t)
+ '("mathclap" ["Mathstyle"] t)
+ '("mathmakebox" [TeX-arg-size] [ TeX-arg-size ] 1)
+ '("clap" 1)
+ '("mathmbox" 1)
+ '("cramped" 1)
+ '("crampedllap" [ "Mathstye" ] t)
+ '("crampedrlap" [ "Mathstyle" ] t)
+ '("crampedclap" [ "Mathstyle" ] t)
+ '("smashoperator" [ "Position (l, r or lr (default)" ] 2)
+ ;; 3.1.4 Adjusting the limits of operators
+ ;; explicit argument encapsulation does not seem to be required
+ '("adjustlimits" 4)
+ ;; 3.2 Controlling tags
+ '("newtagform" "Name" ["Inner format"] "Left" "Right")
+ '("renewtagform" "Name" ["Inner format"] "Left" "Right")
+ '("usetagform" "Name")
+ '("xleftrightarrow" ["Below"] "Above")
+ '("xLeftarrow" ["Below"] "Above")
+ '("xRightarrow" ["Below"] "Above")
+ '("xLeftrightarrow" ["Below"] "Above")
+ '("xhookleftarrow" ["Below"] "Above")
+ '("xhookrightarrow" ["Below"] "Above")
+ '("xmapsto" ["Below"] "Above")
+ '("xrightharpoondown" ["Below"] "Above")
+ '("xrightharpoonup" ["Below"] "Above")
+ '("xleftharpoondown" ["Below"] "Above")
+ '("xleftharpoonup" ["Below"] "Above")
+ '("xrightleftharpoons" ["Below"] "Above")
+ '("xleftrightharpoons" ["Below"] "Above")
+ '("underbracket" [ "Rule thickness" ] [ "Bracket height" ] t)
+ '("overbracket" [ "Rule thickness" ] [ "Bracket height" ] t)
+ '("underbrace" 1)
+ '("overbrace" 1)
+ '("LaTeXunderbrace" 1)
+ '("LaTeXoverbrace" 1)
+ ;; 3.4.2
+ '("shoveleft" [ TeX-arg-size ] 1)
+ '("shoveright" [ TeX-arg-size ] 1)
+ ;; don't understand t, but intertext in amsmath.el uses it
+ '("shortintertext" t)
+ '("DeclarePairedDelimeter" TeX-arg-macro "Left delimeter" "Right
delimeter")
+ ;; 3.4.4
+ '("MoveEqLeft" [ "Number" ])
+ '("ArrowBetweenLines" [ TeX-arg-macro ] )
+ '("ArrowBetweenLines*" [ TeX-arg-macro ] )
+ ;; colon operators
+ "vcentcolon" "ordinarycolon" "coloneqq" "Coloneqq"
+ "coloneq" "Coloneq" "eqqcolon" "Eqqcolon" "eqcolon"
+ "Eqcolon" "colonapprox" "Colonapprox" "colonsim" "Colonsim"
+ ;; 3.7.1
+ "lparen" "rparen"
+ ;; left sub/superscripts
+ '("prescript" "Below" "Above" t)
+ ;; Declaring math sizes; this command doesn't seem so relevant, but
+ ;; for completion, it's included
+ '("DeclareMathSizes" 4)
+ ;; Gathered envionments
+ '("newgather" "Name" "Pre-line" "Post-line" "After")
+ '("renewgather" "Name" "Pre-line" "Post-line" "After")
+ ;; Split fractions
+ '("splitfrac" 2)
+ '("splitdfrac" 2))
+
+ (setq LaTeX-item-list
+ (append '(("multlined" . LaTeX-item-equation)
+ ("lgathered" . LaTeX-item-equation)
+ ("rgathered" . LaTeX-item-equation)
+ ("spreadlines" . LaTeX-item-equation)
+ ("matrix*" . LaTeX-item-equation)
+ ("pmatrix*" . LaTeX-item-equation)
+ ("bmatrix*" . LaTeX-item-equation)
+ ("Bmatrix*" . LaTeX-item-equation)
+ ("vmatrix*" . LaTeX-item-equation)
+ ("Vmatrix*" . LaTeX-item-equation)
+ ("dcases" . LaTeX-item-equation)
+ ("dcases*" . LaTeX-item-equation))
+ LaTeX-item-list))
+
+ (setq LaTeX-label-alist
+ (append '(("lgathered" . LaTeX-amsmath-label)
+ ("rgathered" . LaTeX-amsmath-label)
+ ("multlined" . LaTeX-amsmath-label)
+ LaTeX-label-alist)))))
(defun LaTeX-mathtools-env-matrix-starred (env)
(let ((where (read-string "(optional) Vertical placement of columns: ")))
@@ -188,10 +197,4 @@
(LaTeX-insert-environment env extra)
(newline-and-indent)))
-;; amsmath options can also be passed directly to mathtools
-(defvar LaTeX-mathtools-package-options
- (append '("fixamsmath" "donotfixamsmathbugs"
- "allowspaces" "disallowspaces") LaTeX-amsmath-package-options)
- "Package options for the mathtools package.")
-
;;; mathtools.el ends here.