[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 108/299: Some improvements to amsthm style file.
From: |
Stefan Monnier |
Subject: |
[elpa] 108/299: Some improvements to amsthm style file. |
Date: |
Sun, 02 Nov 2014 03:10:41 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 02768a760ebb6851313eb069b5c42ae467dbe3a6
Author: Mosè Giordano <address@hidden>
Date: Fri Apr 19 15:47:09 2013 +0200
Some improvements to amsthm style file.
* style/amsthm.el (LaTeX-amsthm-package-options): New variable.
("amsthm"): Remove `newtheorem' macro, already defined in
`latex.el'. Use `TeX-arg-define-environment' in `newtheorem*'
macro. Add `qedhere', `swapnumbers', and `newtheoremstyle'
macros. Add `newtheorem*' regexp to match new environments. Add
fontification.
---
ChangeLog | 7 ++++++
style/amsthm.el | 56 ++++++++++++++++++++++++++++++++++++------------------
2 files changed, 44 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 60f1186..af6b142 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2013-04-19 Mos� Giordano <address@hidden>
+ * style/amsthm.el (LaTeX-amsthm-package-options): New variable.
+ ("amsthm"): Remove `newtheorem' macro, already defined in
+ `latex.el'. Use `TeX-arg-define-environment' in `newtheorem*'
+ macro. Add `qedhere', `swapnumbers', and `newtheoremstyle'
+ macros. Add `newtheorem*' regexp to match new environments. Add
+ fontification.
+
* style/article.el ("article"): Add counters and pagestyles.
* style/beamer.el ("beamer"): Ditto.
diff --git a/style/amsthm.el b/style/amsthm.el
index 9903040..2214980 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -1,6 +1,6 @@
;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.
-;; Copyright (C) 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2013 Free Software Foundation, Inc.
;; Author: Carsten Dominik <address@hidden>
;; Maintainer: address@hidden
@@ -24,24 +24,42 @@
;;; 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)
- ))))
+(defvar LaTeX-amsthm-package-options nil
+ "Package options for the amsthm package.")
+
+(TeX-add-style-hook
+ "amsthm"
+ (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*" TeX-arg-define-environment "Heading")
+ '("theoremstyle" LaTeX-amsthm-complete-theoremstyle)
+ "qedhere"
+ "swapnumbers"
+ '("newtheoremstyle" "Style name" (TeX-arg-length nil "Space above")
+ (TeX-arg-length nil "Space below") "Body font" "Indent amount"
+ "Theorem head font" "Punctuation after head"
+ (TeX-arg-length nil "Space after head") "Theorem head spec"))
+
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\newtheorem\\*{\\(" TeX-token-char "+\\)}")
+ 1 LaTeX-auto-environment))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("newtheorem" "*{[{[")
+ ("theoremstyle" "{")
+ ("newtheoremstyle" "{{{{{{{{{"))
+ 'function))))
(defun LaTeX-amsthm-complete-theoremstyle (&rest ignore)
(insert TeX-grop
- [elpa] 101/299: Improve Evince backward search., (continued)
- [elpa] 101/299: Improve Evince backward search., Stefan Monnier, 2014/11/01
- [elpa] 94/299: Fix 2 bugs in DBUS communication., Stefan Monnier, 2014/11/01
- [elpa] 104/299: Change default value of `LaTeX-default-author' and adapt `LaTeX-arg-author'., Stefan Monnier, 2014/11/01
- [elpa] 96/299: Raise frame on backward search., Stefan Monnier, 2014/11/01
- [elpa] 105/299: Fix plain TeX abbrev table name., Stefan Monnier, 2014/11/01
- [elpa] 102/299: Document some missing functions and options., Stefan Monnier, 2014/11/01
- [elpa] 103/299: Use user-full-name as initial input to author macro., Stefan Monnier, 2014/11/01
- [elpa] 100/299: Better unbinding of SPC in LaTeX-arg-acro-key-val and LaTeX-arg-siunitx-unit., Stefan Monnier, 2014/11/01
- [elpa] 106/299: Add beamer class options., Stefan Monnier, 2014/11/01
- [elpa] 95/299: Add new style files acro.el and acronym.el., Stefan Monnier, 2014/11/01
- [elpa] 108/299: Some improvements to amsthm style file.,
Stefan Monnier <=
- [elpa] 107/299: Add counters and pagestyle to some class styles., Stefan Monnier, 2014/11/01
- [elpa] 110/299: Set default environment for some class styles., Stefan Monnier, 2014/11/01
- [elpa] 113/299: Change BibTeX button to Biber when LaTeX-using-biber is non-nil., Stefan Monnier, 2014/11/01
- [elpa] 112/299: Add new variable `LaTeX-default-document-environment'., Stefan Monnier, 2014/11/01
- [elpa] 111/299: Add history variables in some style files., Stefan Monnier, 2014/11/01
- [elpa] 115/299: Document LaTeX-default-document-environment., Stefan Monnier, 2014/11/01
- [elpa] 114/299: Wrap dollars around active region typing `$'., Stefan Monnier, 2014/11/01
- [elpa] 119/299: Fixes to TeX-arg-index-tag, TeX-arg-cite, TeX-parse-arguments., Stefan Monnier, 2014/11/01
- [elpa] 117/299: Insert one $ when point is in a verbatim construct., Stefan Monnier, 2014/11/01
- [elpa] 109/299: Fix in TeX-arg-insert-braces., Stefan Monnier, 2014/11/01