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


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. f6edd15942985c89a571c48a188ca1213465160d
Date: Wed, 15 Dec 2021 05:35:06 -0500 (EST)

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  f6edd15942985c89a571c48a188ca1213465160d (commit)
       via  19cd0476e83e49b481dd9e0698c30d647271a00c (commit)
      from  22e4415f65ac1b005ce70f637366efb4defa399c (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 f6edd15942985c89a571c48a188ca1213465160d
Author: Arash Esbati <arash@gnu.org>
Date:   Wed Dec 15 11:33:43 2021 +0100

    Add style/sidecap.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/sidecap.el: New file.

diff --git a/Makefile.in b/Makefile.in
index 63bb268..3ef294c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -178,7 +178,7 @@ STYLESRC = style/prosper.el \
           style/xr.el        style/cancel.el    style/unicodefonttable.el \
           style/cuted.el     style/floatpag.el  style/flushend.el \
           style/midfloat.el  style/stabular.el  style/stfloats.el \
-          style/rotating.el
+          style/rotating.el  style/sidecap.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/sidecap.el b/style/sidecap.el
new file mode 100644
index 0000000..bcd019c
--- /dev/null
+++ b/style/sidecap.el
@@ -0,0 +1,160 @@
+;;; sidecap.el --- AUCTeX style for `sidecap.sty' (v1.6f)  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2021-12-11
+;; 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 `sidecap.sty' (v1.6f) from 2003/06/06.
+;; `sidecap.sty' is part of TeXLive.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+(defun LaTeX-env-sidecap-float (environment)
+  "Create ENVIRONMENT with \\caption and \\label commands.
+This function is a copy of `LaTeX-env-figure' and adjusted to
+read the first optional argument 'relwidth' provided by
+environments of the package sidecap."
+  (let* ((relwidth (TeX-read-string
+                    (TeX-argument-prompt t nil "Relative caption width")))
+         (float (and LaTeX-float        ; LaTeX-float can be nil, i.e.
+                                        ; do not prompt
+                     (TeX-read-string "(Optional) Float position: " 
LaTeX-float)))
+         (caption (TeX-read-string "Caption: "))
+         (short-caption (when (>= (length caption) 
LaTeX-short-caption-prompt-length)
+                          (TeX-read-string "(Optional) Short caption: ")))
+         (center (y-or-n-p "Center? "))
+         (active-mark (and (TeX-active-mark)
+                           (not (eq (mark) (point)))))
+         start-marker end-marker)
+    (when active-mark
+      (if (< (mark) (point))
+          (exchange-point-and-mark))
+      (setq start-marker (point-marker))
+      (set-marker-insertion-type start-marker t)
+      (setq end-marker (copy-marker (mark))))
+    (setq LaTeX-float float)
+    (LaTeX-insert-environment environment
+                              (concat
+                               ;; First check if 'relwidth' is given:
+                               (when (and relwidth
+                                          (not (string= relwidth "")))
+                                 (concat LaTeX-optop relwidth
+                                         LaTeX-optcl))
+                               ;; We have to insert a pair of brackets
+                               ;; if 'float' is given and 'relwidth'
+                               ;; was empty, otherwise 'float' becomes
+                               ;; 'relwidth':
+                               (unless (zerop (length float))
+                                 (concat
+                                  (when (or (null relwidth)
+                                            (string= relwidth ""))
+                                    (concat LaTeX-optop LaTeX-optcl))
+                                  LaTeX-optop float LaTeX-optcl))))
+    (when active-mark
+      (goto-char start-marker)
+      (set-marker start-marker nil))
+    (when center
+      (insert TeX-esc "centering")
+      (indent-according-to-mode)
+      (LaTeX-newline)
+      (indent-according-to-mode))
+    ;; Insert caption and ask for a label, do nothing if user skips caption
+    (unless (zerop (length caption))
+      (if (member environment LaTeX-top-caption-list)
+          ;; top caption
+          (progn
+            (insert (LaTeX-compose-caption-macro caption short-caption))
+            ;; If `auto-fill-mode' is active, fill the caption.
+            (if auto-fill-function (LaTeX-fill-paragraph))
+            (LaTeX-newline)
+            (indent-according-to-mode)
+            ;; ask for a label and insert a new line only if a label is
+            ;; actually inserted
+            (when (LaTeX-label environment 'environment)
+              (LaTeX-newline)
+              (indent-according-to-mode)))
+        ;; bottom caption (default)
+        (when active-mark (goto-char end-marker))
+        (save-excursion
+          (LaTeX-newline)
+          (indent-according-to-mode)
+          ;; If there is an active region point is before the backslash of
+          ;; "\end" macro, go one line upwards.
+          (when active-mark (forward-line -1) (indent-according-to-mode))
+          (insert (LaTeX-compose-caption-macro caption short-caption))
+          ;; If `auto-fill-mode' is active, fill the caption.
+          (if auto-fill-function (LaTeX-fill-paragraph))
+          ;; ask for a label and if necessary insert a new line between caption
+          ;; and label
+          (when (save-excursion (LaTeX-label environment 'environment))
+            (LaTeX-newline)
+            (indent-according-to-mode)))
+        ;; Insert an empty line between caption and marked region, if any.
+        (when active-mark (LaTeX-newline) (forward-line -1))
+        (indent-according-to-mode)))
+    (when (markerp end-marker)
+      (set-marker end-marker nil))
+    (when (and (member environment '("SCtable" "SCtable*"))
+               ;; Suppose an existing tabular environment should just
+               ;; be wrapped into a table if there is an active region.
+               (not active-mark))
+      (LaTeX-environment-menu LaTeX-default-tabular-environment))))
+
+(TeX-add-style-hook
+ "sidecap"
+ (lambda ()
+
+   ;; Add the environments provided by the package:
+   (LaTeX-add-environments
+    '("SCtable"   LaTeX-env-sidecap-float)
+    '("SCtable*"  LaTeX-env-sidecap-float)
+    '("SCfigure"  LaTeX-env-sidecap-float)
+    '("SCfigure*" LaTeX-env-sidecap-float)
+    '("wide"))
+
+   ;; Add the float environments to `LaTeX-label-alist':
+   (dolist (env '("SCfigure" "SCfigure*"))
+     (add-to-list 'LaTeX-label-alist `(,env . LaTeX-figure-label) t))
+
+   (dolist (env '("SCtable" "SCtable*"))
+     (add-to-list 'LaTeX-label-alist `(,env . LaTeX-table-label) t))
+
+   ;; The next 2 can be set with '\renewcommand':
+   (TeX-add-symbols
+    "sidecaptionsep"
+    "sidecaptionrelwidth"))
+ TeX-dialect)
+
+(defvar LaTeX-sidecap-package-options
+  '("outercaption" "innercaption"
+    "leftcaption" "rightcaption"
+    "wide"
+    "raggedright" "raggedleft" "ragged")
+  "Package options for the sidecap package.")
+
+;;; sidecap.el ends here

commit 19cd0476e83e49b481dd9e0698c30d647271a00c
Author: Arash Esbati <arash@gnu.org>
Date:   Wed Dec 15 11:30:53 2021 +0100

    Add new style/rotating.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/rotating.el: New file.

diff --git a/Makefile.in b/Makefile.in
index 26aebcf..63bb268 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -177,7 +177,8 @@ STYLESRC = style/prosper.el \
           style/portuges.el  style/backref.el   style/xr-hyper.el \
           style/xr.el        style/cancel.el    style/unicodefonttable.el \
           style/cuted.el     style/floatpag.el  style/flushend.el \
-          style/midfloat.el  style/stabular.el  style/stfloats.el
+          style/midfloat.el  style/stabular.el  style/stfloats.el \
+          style/rotating.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/rotating.el b/style/rotating.el
new file mode 100644
index 0000000..fddda47
--- /dev/null
+++ b/style/rotating.el
@@ -0,0 +1,87 @@
+;;; rotating.el --- AUCTeX style for `rotating.sty' (v2.16d)  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2021-12-11
+;; 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 `rotating.sty' (v2.16d) from 2016/08/11.
+;; `rotating.sty' is part of TeXLive.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+(defvar LaTeX-graphicx-package-options)
+
+(TeX-add-style-hook
+ "rotating"
+ (lambda ()
+
+   ;; Environments provided by the package:
+   (LaTeX-add-environments
+    '("sidewaysfigure"  LaTeX-env-figure)
+    '("sidewaysfigure*" LaTeX-env-figure)
+    '("sidewaystable"   LaTeX-env-figure)
+    '("sidewaystable*"  LaTeX-env-figure)
+    "sideways"
+    '("turn"   "Angle")
+    '("rotate" "Angle"))
+
+   ;; Add the float environments to `LaTeX-label-alist':
+   (dolist (env '("sidewaysfigure" "sidewaysfigure*"))
+     (add-to-list 'LaTeX-label-alist `(,env . LaTeX-figure-label) t))
+
+   (dolist (env '("sidewaystable" "sidewaystable*"))
+     (add-to-list 'LaTeX-label-alist `(,env . LaTeX-table-label) t))
+
+   ;; The skips:
+   (LaTeX-add-lengths "rotFPtop" "rotFPbot")
+
+   ;; New symbols
+   (TeX-add-symbols
+    '("turnbox" ["Angle"] "Argument"))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("turnbox"   "[{"))
+                              'textual)))
+ TeX-dialect)
+
+(defvar LaTeX-rotating-package-options
+  (progn
+    (TeX-load-style "graphicx")
+    (append LaTeX-graphicx-package-options
+            '("clockwise"   "counterclockwise" "anticlockwise"
+              "figuresleft" "figuresright"
+              "quiet" "log" "chatter")))
+  "Package options for the rotating package.")
+
+;;; rotating.el ends here

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

Summary of changes:
 Makefile.in       |   3 +-
 style/rotating.el |  87 +++++++++++++++++++++++++++++
 style/sidecap.el  | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 249 insertions(+), 1 deletion(-)
 create mode 100644 style/rotating.el
 create mode 100644 style/sidecap.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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