[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 8990190 16/34: Improve style/algorithm.el
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 8990190 16/34: Improve style/algorithm.el |
Date: |
Sun, 6 Jun 2021 11:40:03 -0400 (EDT) |
branch: externals/auctex
commit 89901901576b1534b5c9d6979ff1648f908bb6b6
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Improve style/algorithm.el
* style/algorithm.el (LaTeX-algorithm-package-options): Add
missing options.
(LaTeX-env-algorithm): Insert a newline only when a label is
really added. Remove unnecessary comments.
("algorithm"): Move `TeX-dialect' to be the third argument of the
hook.
---
style/algorithm.el | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/style/algorithm.el b/style/algorithm.el
index c493c82..e18e19d 100644
--- a/style/algorithm.el
+++ b/style/algorithm.el
@@ -32,10 +32,12 @@
(require 'latex)
(defvar LaTeX-algorithm-package-options
- '("section")
+ '(;; Appearance options:
+ "plain" "ruled" "boxed"
+ ;; Numbering convention:
+ "part" "chapter" "section" "subsection" "subsubsection" "nothing")
"Package options for the algorithm package.")
-
(defun LaTeX-env-algorithm (environment)
"Insert a algorithm-like ENVIRONMENT with caption and label."
(let* ((pos (completing-read (TeX-argument-prompt t nil "Position")
@@ -54,30 +56,25 @@
(when (and short-caption (not (string= short-caption "")))
(insert LaTeX-optop short-caption LaTeX-optcl))
(insert TeX-grop caption)
- ;; ask for a label and insert it
- ; (LaTeX-label environment
'environment)
- ;; the longtable `\caption' is equivalent to a
- ;; `\multicolumn', so it needs a `\\' at the
- ;; end of the line. Prior to that, add } to
- ;; close `\caption{'
- (insert TeX-grcl "")
+ ;; Add } to close `\caption{'
+ (insert TeX-grcl)
;; fill the caption
(LaTeX-fill-paragraph)
;; Insert a new line and indent
(LaTeX-newline)
- (LaTeX-label environment 'environment)
- (LaTeX-newline)
- (indent-according-to-mode))))
-
+ (indent-according-to-mode)
+ ;; Finally add a \label:
+ (when (LaTeX-label environment 'environment)
+ (LaTeX-newline)
+ (indent-according-to-mode)))))
(TeX-add-style-hook
"algorithm"
(lambda ()
(LaTeX-add-environments
- '("algorithm" LaTeX-env-algorithm ))
+ '("algorithm" LaTeX-env-algorithm))
(TeX-add-symbols
- '("listofalgorithms" 0))
- TeX-dialect))
-
+ '("listofalgorithms" 0)))
+ TeX-dialect)
;;; algorithm.el ends here
- [elpa] externals/auctex 6050e27 12/34: Add new variable `TeX-normal-mode-reset-list', (continued)
- [elpa] externals/auctex 6050e27 12/34: Add new variable `TeX-normal-mode-reset-list', Tassilo Horn, 2021/06/06
- [elpa] externals/auctex a6121fb 13/34: Fix fontification when $ is unclosed in buffer, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 3c8e583 08/34: Introduce new variable `LaTeX-global-package-files', Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 605cfc2 14/34: Add new test, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex afab0e0 17/34: Indent region (bug#48518), Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 4309e91 15/34: ; * tex.el (TeX-command-list): Remove linebreak in :help string., Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 2a4cbbb 21/34: Improve `TeX-electric-macro' in Texinfo mode, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex b5f34a9 23/34: Followup my commit on May 6, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex a21c10a 29/34: Check for `auto-fill-function' before filling, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 93d66d1 31/34: Adapt for Texinfo mode, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 8990190 16/34: Improve style/algorithm.el,
Tassilo Horn <=
- [elpa] externals/auctex 34ab611 22/34: Improve completion, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex a8e1a5d 18/34: Update documentation, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 1ded6fc 24/34: Fix markups in documents, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex e7b25d1 26/34: Use #' rather than ' to quote function names, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex bb1bb25 27/34: Remove backspace as paragraph separator, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 154fc6e 28/34: Only re-fill \item contents if auto-fill-mode is active (bug#48760), Tassilo Horn, 2021/06/06
- [elpa] externals/auctex c540e3a 30/34: Define minor modes using keywords, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex cd63c11 32/34: Use own error description for LaTeX mode only, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex dfd6585 33/34: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2021/06/06
- [elpa] externals/auctex 81ce0ee 19/34: Add -dDELAYBIND only when necessary, Tassilo Horn, 2021/06/06