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. f3df76a5c9cbebdfb0a49


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. f3df76a5c9cbebdfb0a49b3c42aae81eebc7c0bf
Date: Sun, 14 Jun 2020 04:35:03 -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  f3df76a5c9cbebdfb0a49b3c42aae81eebc7c0bf (commit)
       via  7a1ebbf331be4961605a388a6a9157d9b4be32bc (commit)
      from  b45bf4d19d599247eccc369444dfab721c5d52aa (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 f3df76a5c9cbebdfb0a49b3c42aae81eebc7c0bf
Author: Uwe Brauer <oub@mat.ucm.es>
Date:   Sat Jun 13 21:18:40 2020 +0200

    Add support for algopseudocde style
    
    * Makefile.in (STYLESRC): Add algopseudocde style
    
    * style/algpseudocode.el: Add support for the algopseudocde (algorithmcx)
        style

diff --git a/Makefile.in b/Makefile.in
index d84d04a..1037fe0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -172,7 +172,7 @@ STYLESRC = style/prosper.el \
           style/changelog.el style/ltugboat.el  style/beamerswitch.el \
           style/multitoc.el  style/fbox.el      style/xkcdcolors.el \
           style/ltxguide.el  style/revtex4-2.el style/overpic.el \
-          style/tex-live.el  style/algorithm.el
+          style/tex-live.el  style/algorithm.el style/algpseudocode.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/algpseudocode.el b/style/algpseudocode.el
new file mode 100644
index 0000000..eaae318
--- /dev/null
+++ b/style/algpseudocode.el
@@ -0,0 +1,73 @@
+;;; algpseudocode.el --- AUCTeX style for the (LaTeX) algpseudocode package
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Created: 2020-01-26
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX 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 3, or (at your option)
+;; any later version.
+
+;; AUCTeX 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 AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+;; This file adds support for the algpseudocode package.
+
+;;; Code:
+
+(defvar LaTeX-algpseudocode-package-options
+  '("compatible" "nocompatible")
+  "Package options for the algpseudocode package.")
+
+
+(TeX-add-style-hook
+ "algpseudocode"
+ (lambda ()
+   (TeX-add-symbols
+    '("algref" 2)
+    '("algstore" 1)
+    '("algrestore" 1)
+    '("algstore*" 1)
+    '("algrestore*" 1)
+    '("Procedure" 2)
+    '("Comment" 1)
+    '("State" 0)
+    '("While" 0)
+    '("EndWhile" 0)
+    '("EndProcedure" 0)
+    '("Repeat" 0)
+    '("Until" 0)
+    '("For" 1)
+    '("ForAll" 1)
+    '("EndFor" 0)
+    '("If" 1)
+    '("ElsIf" 1)
+    '("Else" 0)
+    '("EndIf" 0)
+    '("Function" 2)
+    '("EndFunction" 0)
+    '("Loop" 0)
+    '("EndLoop" 0)
+    '("Require" 0)
+    '("Ensure" 0)
+    '("State" 0)
+    '("Statex" 0)
+    '("Call" 0))
+   (LaTeX-add-environments
+    '("algorithmic" [ "Number" ]))
+   LaTeX-dialect))
+
+;;; algpseudocode.el ends here

commit 7a1ebbf331be4961605a388a6a9157d9b4be32bc
Author: Uwe Brauer <oub@mat.ucm.es>
Date:   Sat Jun 13 21:44:27 2020 +0200

    Add support for algorithm style
    
    * Makefile.in (STYLESRC): Add algorithm style
    
    * style/algorithm.el: Add support for the algorithm style

diff --git a/Makefile.in b/Makefile.in
index 6e599c3..d84d04a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -172,7 +172,7 @@ STYLESRC = style/prosper.el \
           style/changelog.el style/ltugboat.el  style/beamerswitch.el \
           style/multitoc.el  style/fbox.el      style/xkcdcolors.el \
           style/ltxguide.el  style/revtex4-2.el style/overpic.el \
-          style/tex-live.el
+          style/tex-live.el  style/algorithm.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/algorithm.el b/style/algorithm.el
new file mode 100644
index 0000000..8004002
--- /dev/null
+++ b/style/algorithm.el
@@ -0,0 +1,80 @@
+;;; algorithm.el --- AUCTeX style for the (LaTeX) algorithm package
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Created: 2020-01-26
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX 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 3, or (at your option)
+;; any later version.
+
+;; AUCTeX 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 AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+;; This file adds support for the algorithm package.
+
+;;; Code:
+
+(defvar LaTeX-algorithm-package-options
+  '("section")
+  "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")
+                              '(("H"))))
+        (caption (TeX-read-string "Caption: "))
+        (short-caption (when (>= (length caption) 
LaTeX-short-caption-prompt-length)
+                         (TeX-read-string "(Optional) Short caption: "))))
+    (LaTeX-insert-environment environment
+                             (concat
+                              (unless (zerop (length pos))
+                                (concat LaTeX-optop pos LaTeX-optcl))))
+    ;; top caption -- do nothing if user skips caption
+    (unless (zerop (length caption))
+      ;; insert `\caption[short-caption]{caption':
+      (insert TeX-esc "caption")
+      (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 "")
+      ;; fill the caption
+      (LaTeX-fill-paragraph)
+      ;; Insert a new line and indent
+      (LaTeX-newline)
+      (LaTeX-label environment 'environment)
+      (LaTeX-newline)
+      (indent-according-to-mode))))
+
+
+(TeX-add-style-hook
+ "algorithm"
+ (lambda ()
+   (LaTeX-add-environments
+    '("algorithm"  LaTeX-env-algorithm ))
+   (TeX-add-symbols
+    '("listofalgorithms" 0))
+      LaTeX-dialect))
+
+
+;;; algorithm.el ends here

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

Summary of changes:
 Makefile.in            |  2 +-
 style/algorithm.el     | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++
 style/algpseudocode.el | 73 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 154 insertions(+), 1 deletion(-)
 create mode 100644 style/algorithm.el
 create mode 100644 style/algpseudocode.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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