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


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. ee4cc54ab3dd890f11f514f9a37b35bce7883eb3
Date: Sun, 12 Nov 2017 10:04:05 -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  ee4cc54ab3dd890f11f514f9a37b35bce7883eb3 (commit)
       via  f0145f462bb2253627138d98d39da49842bd2178 (commit)
      from  ea7ff484e5c94eae48e72eaae0f26486cb0338cd (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 ee4cc54ab3dd890f11f514f9a37b35bce7883eb3
Author: Arash Esbati <address@hidden>
Date:   Sun Nov 12 16:03:22 2017 +0100

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

diff --git a/Makefile.in b/Makefile.in
index 4f2910a..abe2b2e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -167,7 +167,8 @@ STYLESRC = style/prosper.el \
           style/preview.el   style/fvextra.el   style/jurabib.el \
           style/csquotes.el  style/babel.el     style/dk-bib.el \
           style/floatrow.el  style/moodle.el    style/canadian.el \
-          style/arabxetex.el style/australian.el style/newzealand.el
+          style/arabxetex.el style/australian.el style/newzealand.el \
+          style/xltabular.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/xltabular.el b/style/xltabular.el
new file mode 100644
index 0000000..e78b4e9
--- /dev/null
+++ b/style/xltabular.el
@@ -0,0 +1,64 @@
+;;; xltabular.el --- AUCTeX style for `xltabular.sty' (v0.05)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <address@hidden>
+;; Maintainer: address@hidden
+;; Created: 2017-11-03
+;; 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 `xltabular.sty' (v0.05) from 2017/10/26.
+;; `xltabular.sty' is part of TeXLive.
+
+(TeX-add-style-hook
+ "xltabular"
+ (lambda ()
+   ;; ltablex loads both tabularx and longtable
+   (TeX-run-style-hooks "ltablex")
+
+   ;; `LaTeX-env-longtable' is provided by `longtable.el':
+   (LaTeX-add-environments
+    '("xltabular" LaTeX-env-longtable))
+
+   ;; Use the enhanced table formatting.  Append to
+   ;; `LaTeX-indent-environment-list' in order not to override custom settings.
+   (add-to-list (make-variable-buffer-local 'LaTeX-indent-environment-list)
+               '("xltabular" LaTeX-indent-tabular) t)
+
+   ;; Append xltabular to `LaTeX-label-alist', in order not to
+   ;; override possible custome values.
+   (add-to-list 'LaTeX-label-alist '("xltabular" . LaTeX-table-label) t)
+
+   ;; Append xltabular to `LaTeX-item-list' with `LaTeX-item-longtable'
+   (add-to-list 'LaTeX-item-list '("xltabular" . LaTeX-item-longtable) t)
+
+   ;; Tell RefTeX -- This is the same entry as for "longtable" in
+   ;; `reftex-label-alist-builtin':
+   (when (fboundp 'reftex-add-label-environments)
+     (reftex-add-label-environments
+      '(("xltabular" ?t nil nil caption)))))
+ LaTeX-dialect)
+
+(defvar LaTeX-xltabular-package-options nil
+  "Package options for the xltabular package.")
+
+;;; xltabular.el ends here

commit f0145f462bb2253627138d98d39da49842bd2178
Author: Arash Esbati <address@hidden>
Date:   Sun Nov 12 15:58:25 2017 +0100

    Add new function `LaTeX-env-longtable'
    
    * style/longtable.el (LaTeX-env-longtable): Add new function.
    Move the body of the anonymous function into this in order to make
    it available for other styles loading longtable.

diff --git a/style/longtable.el b/style/longtable.el
index aeb275e..b57833b 100644
--- a/style/longtable.el
+++ b/style/longtable.el
@@ -1,6 +1,6 @@
 ;;; longtable.el --- AUCTeX style for `longtable.sty'.
 
-;; Copyright (C) 2013--2016  Free Software Foundation, Inc.
+;; Copyright (C) 2013--2017  Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
 ;; Author: Mosè Giordano <address@hidden>
@@ -46,44 +46,47 @@ insert line break macro."
   (LaTeX-insert-ampersands
    LaTeX-longtable-skipping-regexp #'LaTeX-array-count-columns))
 
+(defun LaTeX-env-longtable (environment)
+  "Insert a longtable-like ENVIRONMENT with caption and label."
+  (let* ((pos (completing-read (TeX-argument-prompt t nil "Position")
+                              '(("l") ("r") ("c"))))
+        (fmt (TeX-read-string "Format: " LaTeX-default-format))
+        (caption (TeX-read-string "Caption: "))
+        (short-caption (when (>= (length caption) 
LaTeX-short-caption-prompt-length)
+                         (TeX-read-string "(Optional) Short caption: "))))
+    (setq LaTeX-default-format fmt)
+    (LaTeX-insert-environment environment
+                             (concat
+                              (unless (zerop (length pos))
+                                (concat LaTeX-optop pos LaTeX-optcl))
+                              (concat TeX-grop fmt TeX-grcl)))
+    ;; 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)
+      (indent-according-to-mode))
+    ;; Insert suitable number of &'s, suppress line break
+    (LaTeX-item-longtable t)))
+
 (TeX-add-style-hook
  "longtable"
  (lambda ()
    (LaTeX-add-environments
-    '("longtable" (lambda (environment)
-                   (let* ((pos (completing-read (TeX-argument-prompt t nil 
"Position")
-                                                '(("l") ("r") ("c"))))
-                          (fmt (TeX-read-string "Format: " 
LaTeX-default-format))
-                          (caption (TeX-read-string "Caption: "))
-                          (short-caption (when (>= (length caption) 
LaTeX-short-caption-prompt-length)
-                                           (TeX-read-string "(Optional) Short 
caption: "))))
-                     (setq LaTeX-default-format fmt)
-                     (LaTeX-insert-environment environment
-                                               (concat
-                                                (unless (zerop (length pos))
-                                                  (concat LaTeX-optop pos 
LaTeX-optcl))
-                                                (concat TeX-grop fmt 
TeX-grcl)))
-                     ;; 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)
-                       (indent-according-to-mode))
-                     ;; Insert suitable number of &'s, suppress line break
-                     (LaTeX-item-longtable t)))))
+    '("longtable" LaTeX-env-longtable))
 
    (TeX-add-symbols
     ;; Commands to end table rows

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

Summary of changes:
 Makefile.in        |  3 ++-
 style/longtable.el | 73 ++++++++++++++++++++++++++++--------------------------
 style/xltabular.el | 64 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 104 insertions(+), 36 deletions(-)
 create mode 100644 style/xltabular.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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