Anonymous avatar Anonymous committed 5f2898c

new

Comments (0)

Files changed (7)

+;;; amsbsy.el --- Style hook for the AMS-LaTeX amsbsy package.
+;;;
+;;; AUTHOR: Carsten Dominik <dominik@strw.leidenuniv.nl>
+
+;;; Code:
+
+(TeX-add-style-hook "amsbsy"
+ (function
+  (lambda ()
+    (TeX-add-symbols
+     '("boldsymbol" "Symbol")
+     '("pmb"        "Symbol")
+     ))))
+
+;;; amsbsy.el ends here.
+;;; amsmath.el --- Style hook for the AMS-LaTeX amsmath package.
+;;;
+;;; This will also load the amstext, amsbsy and amsopn style files.
+;;; AUTHOR: Carsten Dominik <dominik@strw.leidenuniv.nl>
+
+;;; Code:
+
+(TeX-add-style-hook "amsmath"
+ (function
+  (lambda ()
+
+    (LaTeX-add-environments
+     '("align"      LaTeX-env-label)
+     '("gather"     LaTeX-env-label)
+     '("flalign"    LaTeX-env-label)
+     '("multline"   LaTeX-env-label)
+     '("alignat"    LaTeX-amsmath-env-alignat)
+     '("alignat*"   LaTeX-amsmath-env-alignat)
+     '("xalignat"   LaTeX-amsmath-env-alignat)
+     '("xalignat*"  LaTeX-amsmath-env-alignat)
+     '("xxalignat"  LaTeX-amsmath-env-alignat)
+     '("xxalignat*" LaTeX-amsmath-env-alignat)
+     '("aligned"    LaTeX-amsmath-env-aligned)
+     '("gathered"   LaTeX-amsmath-env-aligned)
+     "align*" "gather*" "flalign*" "multline*" "equation*"
+     "alignat*" "xalignat*" "xxalignat*" 
+     "split"
+     "cases"
+     "matrix" "smallmatrix" "pmatrix" "bmatrix" "Bmatrix" "vmatrix" "Vmatrix"
+     "subequations" "subarray"
+     )
+
+    (TeX-add-symbols
+     '("eqref" TeX-arg-ref)
+     '("numberwithin" TeX-arg-counter "Section level")
+     '("raisetag" "Dimension")
+     '("intertext" t)
+     '("hdotsfor" ["Stretch"] "Number of columns to cover")
+     '("xleftarrow" ["Below"] "Above")
+     '("xrightarrow" ["Below"] "Above")
+     '("overset" "Accent symbol" "Symbol")
+     '("underset" "Accent symbol" "Symbol")
+     '("dfrac" 2)
+     '("tfrac" 2)
+     '("binom" 2)
+     '("dbinom" 2)
+     '("tbinom" 2)
+     '("genfrac" "Left delimiter" "Right delimiter" "Thickness"
+       "Mathstyle" 2)
+     '("cfrac" ["position (l or r)"] t)
+     '("smash" ["where (t or b)"] t)
+     '("sideset" "Left" "Right")
+     '("tag" "(Tag)")
+     '("tag*" "Tag")
+     '("raisetag" "Dimension")
+     '("displaybreak" ["Weight (0..4)"])
+     '("allowdisplaybreaks" ["Weight (1..4)"])
+     '("substack" t)
+     '("leftroot" "Push root index left by")
+     '("uproot" "Push root index left by")
+     '("boxed" t)
+     "overleftarrow"  "overrightarrow"  "overleftrightarrow"
+     "underleftarrow" "underrightarrow" "underleftrightarrow"
+     "dotssc" "dotssb" "dotssm" "nobreakdash" 
+     "Hat" "Check" "Tilde" "Acute" "Grave" "Dot" "Ddot" "Breve" "Bar" "Vec"
+     "dddot" "ddddot"
+     "lvert" "rvert" "lVert" "rVert" 
+     "iint" "iiint" "iiiint" "idotsint"
+     )
+    
+    ;; amsmath includes amstext, amsbsy, & amsopn.
+    ;; So we run their hooks, too.
+    (TeX-run-style-hooks "amstext" "amsbsy" "amsopn")
+
+    ;; If RefTeX is loaded, make it recognize the amsmath environments.
+    (if (featurep 'reftex)
+	(reftex-add-to-label-alist '(AMSTeX)))
+    )))
+
+(defun LaTeX-amsmath-env-alignat (env)
+  (let ((ncols (read-string "Number of columns: ")))
+    (LaTeX-insert-environment env (concat TeX-grop ncols TeX-grcl))
+    (and (LaTeX-label environment)
+	 (newline-and-indent))))
+
+(defun LaTeX-amsmath-env-aligned (env)
+  (let ((where (read-string "(optional) Vertical position (t or b): ")))
+    (if (string= where "")
+	(setq where "")
+      (setq where (concat "[" where "]")))
+    (LaTeX-insert-environment env where)))
+
+;;; amsmath.el ends here.
+;;; amsopn.el --- Style hook for the AMS-LaTeX amsopn package.
+;;;
+;;; AUTHOR: Carsten Dominik <dominik@strw.leidenuniv.nl>
+
+;;; Code:
+
+(TeX-add-style-hook "amsopn"
+ (function
+  (lambda ()
+    (TeX-add-symbols
+     '("DeclareMathOperator"  "Operator (with \\)" "Text")
+     '("DeclareMathOperator*" "Operator (with \\)" "Text")
+     "mod" "bmod" "pmod" "pod"
+     ))))
+
+;;; amsopn.el ends here.
+;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.
+;;;
+;;; AUTHOR: Carsten Dominik <dominik@strw.leidenuniv.nl>
+
+;;; Code:
+
+(TeX-add-style-hook "amsthm"
+ (function
+  (lambda ()
+    (LaTeX-add-environments
+     '("proof" (lambda (env &rest ignore)
+		 (LaTeX-insert-environment 
+		  env
+		  (let ((heading (read-string "(optional) Heading: ")))
+		    (if (string= heading "")
+			""
+		      (format "[%s]" heading))))))
+     )
+    (TeX-add-symbols
+     '("newtheorem" "Environment name" ["Share numbering with"] "Heading"
+       ["Number subordinated in each"])
+     '("newtheorem*" "Environment name" "Heading")
+     '("theoremstyle" LaTeX-amsthm-complete-theoremstyle)
+     ))))
+
+(defun LaTeX-amsthm-complete-theoremstyle (&rest ignore)
+  (insert TeX-grop
+	  (completing-read  "Style: " '(("plain" . nil)
+					("definition" . nil)
+					("remark" . nil)))
+	  TeX-grcl))
+
+;;; amsthm.el ends here.
+;;; czech.el - Setup AUC TeX for editing Czech text.
+
+(TeX-add-style-hook "czech"
+ (function (lambda ()
+   (make-local-variable 'TeX-open-quote)
+   (make-local-variable 'TeX-close-quote)
+   (setq TeX-open-quote "\\uv{")
+   (setq TeX-close-quote "}")
+   (run-hooks 'TeX-language-cz-hook))))
+
+;; Support for the natbib package for AUC-TeX
+;;      The natbib package is from Patrick W. Daly
+;;      available on the CTAN servers
+
+;; Version: $Id$
+
+;; Copyright (C) 1997 Berwin Turlach <berwin.turlach@anu.edu.au>
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 1, or (at your option)
+;; any later version.
+;; 
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;; 
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+;; USA
+
+
+;;; Code:
+
+(require 'latex)
+
+(TeX-add-style-hook "natbib"
+ (function
+  (lambda ()
+
+    (TeX-add-symbols
+     '("citet"
+       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+       TeX-arg-cite)
+     '("citet*"
+       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+       TeX-arg-cite)
+     '("citealt"
+       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+       TeX-arg-cite)
+     '("citealt*"
+       (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
+       TeX-arg-cite)
+     '("citep"
+       natbib-arg-cite)
+     '("citep*"
+       natbib-arg-cite)
+     '("citeauthor"
+       TeX-arg-cite)
+     '("citeyear"
+       TeX-arg-cite)
+     '("citefullauthor"
+       TeX-arg-cite)
+     )
+
+    (setq TeX-complete-list
+	  (append '(("\\\\citet\\(\\[[^]\n\r\\%]*\\]\\)+{\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list "}")
+                    ("\\\\citet{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citet{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list)
+                    ("\\\\citet\\*\\(\\[[^]\n\r\\%]*\\]\\)+{\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list "}")
+                    ("\\\\citet\\*{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citet\\*{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list)
+                    ("\\\\citealt\\(\\[[^]\n\r\\%]*\\]\\)+{\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list "}")
+                    ("\\\\citealt{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citealt{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list)
+                    ("\\\\citealt\\*\\(\\[[^]\n\r\\%]*\\]\\)+{\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list "}")
+                    ("\\\\citealt\\*{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citealt\\*{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list)
+                    ("\\\\citep\\(\\[[^]\\%]*\\]\\)+{\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list "}")
+                    ("\\\\citep\\(\\[[^]\\%]*\\]\\)+{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                     3 LaTeX-bibitem-list "}")
+                    ("\\\\citep{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citep{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list)
+                    ("\\\\citep\\*\\(\\[[^]\n\r\\%]*\\]\\)+{\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list "}")
+                    ("\\\\citep\\*{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citep\\*{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)"
+                     2 LaTeX-bibitem-list)
+                    ("\\\\citeyear{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citeauthor{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}") 
+                    ("\\\\citefullauthor{\\([^{}\n\r\\%,]*\\)" 1
+                     LaTeX-bibitem-list "}"))
+		  TeX-complete-list))
+    )))
+
+(defun natbib-arg-cite (optional &optional prompt definition)
+  "Prompt for a BibTeX citation with completion for natbib style."
+  (let ((< "[")
+        (> "]"))
+    (if TeX-arg-cite-note-p
+        (progn
+          (let ((note (read-string
+                       (TeX-argument-prompt optional prompt "Pre-note"))))
+            (if (string-equal note "")
+                (natbib-argument-insert (read-string
+                                         (TeX-argument-prompt optional prompt "Post-note" )))
+              (natbib-argument-insert note)
+              (natbib-argument-insert (read-string
+                                       (TeX-argument-prompt optional prompt "Post-note" ))))))
+      nil))
+  (setq prompt (concat (if optional "(Optional) " "")
+                       (if prompt prompt "Add key")
+                       ": (default none) "))
+  (let ((items (multi-prompt "," t prompt (LaTeX-bibitem-list))))
+    (apply 'LaTeX-add-bibitems items)
+    (TeX-argument-insert (mapconcat 'identity items ",") optional optional))
+  )
+
+(defun natbib-argument-insert (name)
+  "Insert NAME surrounded by square brackets."
+  (insert <)
+  (insert name)
+  (insert >))
+
+;; natbib.el ends here
+;;; slovak.el - Setup AUC TeX for editing Slovak text.
+
+(TeX-add-style-hook "slovak"
+ (function (lambda ()
+   (make-local-variable 'TeX-open-quote)
+   (make-local-variable 'TeX-close-quote)
+   (setq TeX-open-quote "\\uv{")
+   (setq TeX-close-quote "}")
+   (run-hooks 'TeX-language-sk-hook))))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.