]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace obsolete subfigure package with subfig
authorArash Esbati <arash@gnu.org>
Wed, 8 Jan 2025 18:12:49 +0000 (19:12 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 11 Jan 2025 11:17:01 +0000 (12:17 +0100)
* doc/misc/reftex.texi (Builtin Label Environments): Mention the
subfig LaTeX package instead of the obsolete subfigure.

* lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin):
Replace obsolete subfigure entry with subfig.  Adjust the macro
names accordingly and the regexp for matching the context.
Unify the descriptions of all entries.
(reftex-default-label-alist-entries): Use subfig as well.

(cherry picked from commit 5c3deffd9f4647e0dff33ffc84a28eb6fedb3012)

doc/misc/reftex.texi
lisp/textmodes/reftex-vars.el

index 5973140734f9e51a5295251503c3e22725949df6..9287858fe29565bc5c49200fab1d0e366141b373 100644 (file)
@@ -1121,12 +1121,12 @@ the @code{\endnote} macro (from @file{endnotes.sty})
 @cindex @code{sidewaystable}, LaTeX environment
 @code{sidewaysfigure}, @code{sidewaystable} (@file{rotating.sty})
 @item
-@cindex @code{subfigure}, LaTeX package
-@cindex LaTeX packages, @code{subfigure}
-@cindex @code{subfigure}, LaTeX environment
-@cindex @code{subfigure*}, LaTeX environment
-@code{subfigure}, @code{subfigure*}, the @code{\subfigure} macro
-(@file{subfigure.sty})
+@cindex @code{subfig}, LaTeX package
+@cindex LaTeX packages, @code{subfig}
+@cindex @code{\subfigure}, LaTeX macro
+@cindex @code{\subtable}, LaTeX macro
+the @code{\subfigure} and @code{\subtable} macros (from
+@file{subfig.sty})
 @item
 @cindex @code{supertab}, LaTeX package
 @cindex LaTeX packages, @code{supertab}
index c6275c94015822004421b35b5672f19ad5dcc9f5..3214f0b98bae14902d81d452d6c84fd372c7567b 100644 (file)
      (("figwindow" ?f nil nil 1)
       ("tabwindow" ?f nil nil 1)))
 
-    (rotating    "Sidewaysfigure and table"
+    (rotating    "The sidewaysfigure and sidewaystable environments"
      (("sidewaysfigure"  ?f nil nil caption)
       ("sidewaysfigure*" ?f nil nil caption)
       ("sidewaystable"   ?t nil nil caption)
       ("sidewaystable*"  ?t nil nil caption)))
 
-    (sidecap      "SCfigure and SCtable"
+    (sidecap      "The SCfigure and SCtable environments"
      (("SCfigure"  ?f nil nil caption)
       ("SCfigure*" ?f nil nil caption)
       ("SCtable"   ?t nil nil caption)
       ("SCtable*"  ?t nil nil caption)))
 
-    (subfigure   "Subfigure environments/macro"
-     (("subfigure"   ?f nil nil caption)
-      ("subfigure*"  ?f nil nil caption)
-      ("\\subfigure[]{}" ?f nil nil 1)))
+    (subfig       "The \\subfigure and \\subtable macros"
+     ;; The main macro \subfloat is ambiguous, so we only support the
+     ;; compat macros for the old subfigure package.  The context regexp
+     ;; must match combinations of
+     ;; \subfigure[list-capt.][sub-capt.]{body}
+     (("\\subfigure[][]{}" ?f "fig:" "~\\subref{%s}"
+       "\\\\subfigure\\(?:\\(?:\\[[^]]*\\]\\)?\\[\\|{\\)")
+      ("\\subtable[][]{}"  ?t "tab:" "~\\subref{%s}"
+       "\\\\subtable\\(?:\\(?:\\[[^]]*\\]\\)?\\[\\|{\\)")))
 
     (supertab    "Supertabular environment"
      (("supertabular" ?t nil nil "\\tablecaption{")))
 
-    (wrapfig     "The wrapfig package"
+    (wrapfig     "The wrapfigure and wraptable environments"
      (("wrapfigure" ?f nil nil caption)
       ("wraptable"  ?t nil nil caption)))
 
-    (ctable    "The ctable package"
+    (ctable    "The \\ctable macro"
      (("\\ctable[]{}{}{}" ?t "tab:" "~\\ref{%s}" 1 ("table" "Tabelle"))))
 
-    (listings  "The listings package"
+    (listings  "The lstlisting environment"
      (("lstlisting" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))
 
-    (minted    "The minted package"
+    (minted    "The listing environment"
      (("listing" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))
 
     ;; The LaTeX core stuff
-    (LaTeX       "LaTeX default environments"
+    (LaTeX       "LaTeX default macros and environments"
      (("section"   ?s "%S" "~\\ref{%s}" (nil . t)
        (regexp "parts?" "chapters?" "chap\\." "sections?" "sect?\\."
                "paragraphs?" "par\\."
@@ -456,9 +461,9 @@ If nil, `follow-mode' will be suspended for stuff in unvisited files."
   :group 'reftex-label-support)
 
 (defcustom reftex-default-label-alist-entries
-  '(amsmath endnotes fancybox floatfig longtable picinpar
-            rotating sidecap subfigure supertab wrapfig
-           listings minted ctable LaTeX)
+  '( amsmath endnotes fancybox floatfig longtable picinpar
+     rotating sidecap subfig supertab wrapfig
+     listings minted ctable LaTeX)
   "Default label alist specifications.  LaTeX should always be the last entry.
 The value of this variable is a list of symbols with associations in the
 constant `reftex-label-alist-builtin'.  Check that constant for a full list
@@ -474,7 +479,8 @@ of options."
                (list 'const :tag (concat (symbol-name (nth 0 x))
                                          ": " (nth 1 x))
                      (nth 0 x)))
-             reftex-label-alist-builtin)))
+             reftex-label-alist-builtin))
+  :version "31.1")
 
 (defcustom reftex-label-alist nil
   "Alist with information on environments for \\label-\\ref use.