]> code.delx.au - gnu-emacs-elpa/blob - packages/auctex-11.86/style/amsthm.el
99030409be05854e89e6ecca9783382347291d66
[gnu-emacs-elpa] / packages / auctex-11.86 / style / amsthm.el
1 ;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.
2
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
4
5 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
6 ;; Maintainer: auctex-devel@gnu.org
7
8 ;; This file is part of AUCTeX.
9
10 ;; AUCTeX is free software; you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
13 ;; any later version.
14
15 ;; AUCTeX is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
22 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 ;; 02110-1301, USA.
24
25 ;;; Code:
26
27 (TeX-add-style-hook "amsthm"
28 (function
29 (lambda ()
30 (LaTeX-add-environments
31 '("proof" (lambda (env &rest ignore)
32 (LaTeX-insert-environment
33 env
34 (let ((heading (read-string "(optional) Heading: ")))
35 (if (string= heading "")
36 ""
37 (format "[%s]" heading))))))
38 )
39 (TeX-add-symbols
40 '("newtheorem" "Environment name" ["Share numbering with"] "Heading"
41 ["Number subordinated in each"])
42 '("newtheorem*" "Environment name" "Heading")
43 '("theoremstyle" LaTeX-amsthm-complete-theoremstyle)
44 ))))
45
46 (defun LaTeX-amsthm-complete-theoremstyle (&rest ignore)
47 (insert TeX-grop
48 (completing-read "Style: " '(("plain" . nil)
49 ("definition" . nil)
50 ("remark" . nil)))
51 TeX-grcl))
52
53 ;;; amsthm.el ends here