auctex-diffs
[Top][All Lists]
Advanced

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

master 05a3dc0d 1/2: Update the caption bundle styles


From: Arash Esbati
Subject: master 05a3dc0d 1/2: Update the caption bundle styles
Date: Fri, 8 Dec 2023 14:06:20 -0500 (EST)

branch: master
commit 05a3dc0ddfb6bbd355f29959f902e49e9c0cdcb9
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Update the caption bundle styles
    
    * style/bicaption.el (LaTeX-arg-bicaption-captionsetup): Delete
    now unneeded function.
    ("bicaption"): Support new macro \bicaptionsetup.
    
    * style/caption.el ("caption"): Remove support for bi-captions in
    \captionsetup which isn't recommended anymore.
    Keep fontification support for 2 optional arguments.
    (LaTeX-caption-supported-float-types): Delete entries which now
    can be set via \subcaptionsetup and \bicaptionsetup.
    (LaTeX-caption-package-options-list): Delete dropped package
    option "compatibility".
    
    * style/subcaption.el ("subcaption"): Support \subcaptionsetup
    macro.
---
 style/bicaption.el  | 36 +++++++++++++++---------------------
 style/caption.el    | 35 +++++++++++++++++------------------
 style/subcaption.el | 12 +++++++++---
 3 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/style/bicaption.el b/style/bicaption.el
index c0ed9773..7437770c 100644
--- a/style/bicaption.el
+++ b/style/bicaption.el
@@ -1,4 +1,4 @@
-;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.1-158)  -*- 
lexical-binding: t; -*-
+;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.6)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
 
@@ -26,8 +26,8 @@
 
 ;;; Commentary:
 
-;; This file adds support for `bicaption.sty' (v1.1-158) from
-;; 2016/03/27.  `bicaption.sty' is part of TeXLive.
+;; This file adds support for `bicaption.sty' (v1.6) from
+;; 2023/07/10.  `bicaption.sty' is part of TeXLive.
 
 ;; If things do not work or when in doubt, press `C-c C-n'.  Comments
 ;; for improvement are welcome.
@@ -139,22 +139,6 @@ arguments."
       (indent-according-to-mode)
       (end-of-line))))
 
-(defun LaTeX-arg-bicaption-captionsetup (optional)
-  "Query for 2 arguments for \"\\captionsetup\" with bicaption.sty loaded.
-When OPTIONAL is non-nil, include both as optional arguments in
-square brackets."
-  (let* ((flttype (completing-read (TeX-argument-prompt optional nil "Float 
type")
-                                  LaTeX-caption-supported-float-types))
-         (biflt (if (and (not (or (string= flttype "bi")
-                                  (string= flttype "bi-first")
-                                  (string= flttype "bi-second")))
-                         flttype (not (string= flttype "")))
-                    (completing-read (TeX-argument-prompt optional nil 
"Bicaption type")
-                                     '("bi" "bi-first" "bi-second"))
-                  "")))
-    (TeX-argument-insert flttype optional)
-    (TeX-argument-insert biflt optional)))
-
 (TeX-add-style-hook
  "bicaption"
  (lambda ()
@@ -164,6 +148,13 @@ square brackets."
 
    ;; Macros
    (TeX-add-symbols
+    '("bicaptionsetup"
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
+      (TeX-arg-key-val (LaTeX-caption-key-val-options)
+                       "First language")
+      (TeX-arg-key-val (LaTeX-caption-key-val-options)
+                       "Second language"))
     '("bicaption"        (LaTeX-arg-bicaption-bicaption))
     '("bicaption*"       (LaTeX-arg-bicaption-bicaption  nil    t))
     '("bicaptionbox"     (LaTeX-arg-bicaption-bicaption  nil   nil  t   t) t)
@@ -175,7 +166,8 @@ square brackets."
 
    ;; \bi(sub)?caption(box)? macros should get their own lines
    (LaTeX-paragraph-commands-add-locally '("bicaption"    "bicaptionbox"
-                                           "bisubcaption" "bisubcaptionbox"))
+                                           "bisubcaption" "bisubcaptionbox"
+                                           "bicaptionsetup"))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
@@ -184,7 +176,9 @@ square brackets."
                                 ("bicaptionbox"    "*[{[{[[")
                                 ("bisubcaption"    "*[{[{")
                                 ("bisubcaptionbox" "*[{[{[["))
-                              'textual)))
+                              'textual)
+     (font-latex-add-keywords '(("bicaptionsetup"  "[{{"))
+                              'function)))
  TeX-dialect)
 
 (defun LaTeX-bicaption-package-options-list ()
diff --git a/style/caption.el b/style/caption.el
index db745142..68366e84 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -206,8 +206,6 @@ package if loaded."
 
 (defvar LaTeX-caption-supported-float-types
   '("figure" "table" "ContinuedFloat"   ; Standard caption.sty
-    "sub" "subtable" "subfigure"        ; subcaption.sty
-    "bi" "bi-first" "bi-second"         ; bicaption.sty
     "ruled" "boxed"                     ; float.sty
     "floatingfigure" "floatingtable"    ; floatflt.sty
     "lstlisting"                        ; listings.sty
@@ -383,26 +381,26 @@ STAR is non-nil, do not query for a short-caption and a 
label."
     '("captionof*" (LaTeX-arg-caption-captionof t))
 
     '("captionsetup"
-      (TeX-arg-conditional (member "bicaption" (TeX-style-list))
-          ([LaTeX-arg-bicaption-captionsetup])
-        ([TeX-arg-completing-read
-          LaTeX-caption-supported-float-types "Float type"]))
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
       (TeX-arg-key-val (LaTeX-caption-key-val-options)))
 
     '("captionsetup*"
-      (TeX-arg-conditional (member "bicaption" (TeX-style-list))
-          ([LaTeX-arg-bicaption-captionsetup])
-        ([TeX-arg-completing-read
-          LaTeX-caption-supported-float-types "Float type"]))
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
       (TeX-arg-key-val (LaTeX-caption-key-val-options)))
 
     '("clearcaptionsetup"
-      [TeX-arg-completing-read (LaTeX-caption-key-val-options) "Single key"]
-      (TeX-arg-completing-read LaTeX-caption-supported-float-types "Float 
type"))
+      [TeX-arg-completing-read (LaTeX-caption-key-val-options)
+                               "Single key"]
+      (TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"))
 
     '("clearcaptionsetup*"
-      [TeX-arg-completing-read (LaTeX-caption-key-val-options) "Single key"]
-      (TeX-arg-completing-read LaTeX-caption-supported-float-types "Float 
type"))
+      [TeX-arg-completing-read (LaTeX-caption-key-val-options)
+                               "Single key"]
+      (TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"))
 
     '("captionbox"  (LaTeX-arg-caption-captionbox) t)
 
@@ -450,8 +448,10 @@ STAR is non-nil, do not query for a short-caption and a 
label."
 
     '("bothIfSecond" 2))
 
-   ;; \caption(box|of) macros should get their own lines
-   (LaTeX-paragraph-commands-add-locally '("captionbox" "captionof"))
+   ;; \caption(of|box|setup) macros should get their own lines
+   (LaTeX-paragraph-commands-add-locally '("captionof"
+                                           "captionbox"
+                                           "captionsetup"))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
@@ -477,8 +477,7 @@ STAR is non-nil, do not query for a short-caption and a 
label."
  TeX-dialect)
 
 (defvar LaTeX-caption-package-options-list
-  (append '(("compatibility"  ("true" "false"))
-            ("figureposition" ("top" "above" "bottom" "below"))
+  (append '(("figureposition" ("top" "above" "bottom" "below"))
             ("tableposition"  ("top" "above" "bottom" "below")))
           LaTeX-caption-key-val-options)
   "Package options for the caption package.")
diff --git a/style/subcaption.el b/style/subcaption.el
index 67b96e4f..c3668511 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -121,6 +121,10 @@ caption, insert only a caption."
 
    (TeX-add-symbols
     ;; Basic commands
+    '("subcaptionsetup"
+      [TeX-arg-completing-read LaTeX-caption-supported-float-types
+                               "Float type"]
+      (TeX-arg-key-val (LaTeX-caption-key-val-options)))
     '("subcaption"     (LaTeX-arg-subcaption-subcaption))
     '("subcaption*"    (LaTeX-arg-subcaption-subcaption     t)  )
     '("subcaptionbox"  (LaTeX-arg-subcaption-subcaptionbox) t)
@@ -162,9 +166,10 @@ caption, insert only a caption."
            '("figure" "table")))
        "Type")))
 
-   ;; \subcaption(box)? and \subfloat macros should get their own lines
+   ;; \subcaption(box|setup)? and \subfloat macros should get their
+   ;; own lines
    (LaTeX-paragraph-commands-add-locally
-    '("subcaption" "subcaptionbox" "subfloat"))
+    '("subcaption" "subcaptionbox" "subcaptionsetup" "subfloat"))
 
    ;; The subfigure & subtable environments
    (LaTeX-add-environments
@@ -192,7 +197,8 @@ caption, insert only a caption."
                               'textual)
      (font-latex-add-keywords '(("subref"                "*{"))
                               'reference)
-     (font-latex-add-keywords '(("DeclareCaptionSubType" "*[{"))
+     (font-latex-add-keywords '(("DeclareCaptionSubType" "*[{")
+                                ("subcaptionsetup"       "[{"))
                               'function)) )
  TeX-dialect)
 



reply via email to

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