auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 89901901576b1534b5c9d


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 89901901576b1534b5c9d6979ff1648f908bb6b6
Date: Thu, 20 May 2021 04:33:27 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  89901901576b1534b5c9d6979ff1648f908bb6b6 (commit)
      from  4309e91e8c8452a17b57ea835b338a1ec73492f1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 89901901576b1534b5c9d6979ff1648f908bb6b6
Author: Arash Esbati <arash@gnu.org>
Date:   Thu May 20 10:32:15 2021 +0200

    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.

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

-----------------------------------------------------------------------

Summary of changes:
 style/algorithm.el | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]