[latex3-commits] [git/LaTeX3-latex3-latex2e] starredrefs: add starred version of ref, Ref, pageref (43f49bf3)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Apr 12 19:33:47 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : starredrefs
Link       : https://github.com/latex3/latex2e/commit/43f49bf3b7f48ae8eeb9e33fae4591ff48c5d1b2

>---------------------------------------------------------------

commit 43f49bf3b7f48ae8eeb9e33fae4591ff48c5d1b2
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Apr 12 19:33:47 2022 +0200

    add starred version of ref,Ref,pageref


>---------------------------------------------------------------

43f49bf3b7f48ae8eeb9e33fae4591ff48c5d1b2
 base/changes.txt                       |   4 +
 base/doc/ltnews35.tex                  |   9 +-
 base/ltxref.dtx                        |  67 ++++++--
 required/tools/changes.txt             |   5 +
 required/tools/showkeys-2014-10-28.sty | 272 +++++++++++++++++++++++++++++++++
 required/tools/showkeys.dtx            |  48 +++---
 6 files changed, 373 insertions(+), 32 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 313072a6..867f0399 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -5,6 +5,10 @@ It is provided for convenience only.  It therefore makes no claims to
 completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
+2021-12-30  Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+
+	* ltxref.dtx:
+	Added starred versions of \ref,\pageref and \Ref
 
 2022-04-03  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
diff --git a/base/doc/ltnews35.tex b/base/doc/ltnews35.tex
index 52fe193d..9842e431 100644
--- a/base/doc/ltnews35.tex
+++ b/base/doc/ltnews35.tex
@@ -455,7 +455,14 @@ lua.get_functions_table()
 %
 \githubissue{536}
 
-
+\subsection{Starred command version for \cs{ref}, \cs{Ref} and \cs{pageref}}
+
+Since a long time \pkg{hyperref} provided starred versions for the reference commands
+that don't create active links. The different syntax required from users and package authors
+to check for \pkg{hyperref} if both types should be supported. The commands have now been aligned with
+the \pkg{hyperref} usage and allow an optional star. The \pkg{showkeys} package
+has been updated to handle the starred versions too, both with \pkg{hyperref} or \pkg{nameref}
+and without.
 
 
 
diff --git a/base/ltxref.dtx b/base/ltxref.dtx
index 53224103..4ac14b1b 100644
--- a/base/ltxref.dtx
+++ b/base/ltxref.dtx
@@ -63,17 +63,18 @@
 %     {Extract file ltxref from ltcntlen.}
 % \changes{v1.1b}{1994/05/21}{Use new warning commands}
 % \changes{v1.1c}{1994/05/25}{Modify documentation}
+% \changes{v1.1p}{2022/04/12}{Add starred variants for the ref commands}
 %
 % \section{Cross Referencing}
 %  The user writes  |\label|\marg{foo}  to define the following
 %  cross-references:
 %
-%   |\ref|\marg{foo}: value of most recently incremented referenceable
+%   |\ref|*\marg{foo}: value of most recently incremented referenceable
 %             counter. in the current environment. (Chapter, section,
 %             theorem and enumeration counters are
 %             referenceable, footnote counters are not.)
 %
-%   |\pageref|\marg{foo}: page number at which |\label{foo}|  command
+%   |\pageref|*\marg{foo}: page number at which |\label{foo}|  command
 %             appeared.  where  foo  can be any string of characters not
 %             containing  `|\|', `|{|' or `|}|'.
 %
@@ -87,6 +88,9 @@
 %  leaving a space on both sides of it is equivalent to leaving
 %  a space on either side.
 %
+%  Note: the starred version |\ref*| and |\pageref*| are provided
+%  to align with the of hyperref.
+%
 %
 % \MaybeStop{}
 %
@@ -206,8 +210,10 @@
 %    \end{macrocode}
 %  \begin{macro}{\ref}
 % \changes{LaTeX2e}{1993/12/11}{Macro reimplemented}
+% \changes{LaTeX2e}{2022/04/12}{Macro reimplemented with a starred version}
 %  \begin{macro}{\pageref}
 % \changes{LaTeX2e}{1993/12/11}{Macro reimplemented}
+% \changes{LaTeX2e}{2022/04/12}{Macro reimplemented with a starred version}
 %  \begin{macro}{\@setref}
 % \changes{LaTeX2e}{1993/12/11}{Macro added}
 % \changes{v1.1h}{1995/10/24}{Switch for refundefined renamed}
@@ -229,9 +235,35 @@
   \else
    \expandafter#2#1\null
   \fi}
-\def\ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}}
-\def\pageref#1{\expandafter\@setref\csname r@#1\endcsname
-                                   \@secondoftwo{#1}}
+%    \end{macrocode}
+%    \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2022/06/01}%
+%<latexrelease>                 {\ref}{Add starred reference commands}%
+%    \end{macrocode}
+%    \begin{macrocode}
+\def\@kernel at sref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}}
+\def\@kernel at spageref#1{\expandafter\@setref\csname r@#1\endcsname
+                 \@secondoftwo{#1}}
+\let\@kernel at ref\@kernel at sref
+\let\@kernel at pageref\@kernel at spageref
+\NewDocumentCommand\ref{s}
+   {\IfBooleanTF{#1}{\@kernel at sref}{\@kernel at ref}}
+\NewDocumentCommand\pageref{s}
+   {\IfBooleanTF{#1}{\@kernel at spageref}{\@kernel at pageref}}
+%    \end{macrocode}
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\ref}{Add starred reference commands}%
+%<latexrelease>\def\ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}}
+%<latexrelease>\def\pageref#1{\expandafter\@setref\csname r@#1\endcsname
+%<latexrelease>                                   \@secondoftwo{#1}}
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
 %    \end{macrocode}
 %  \end{macro}
 %  \end{macro}
@@ -311,8 +343,8 @@
 %    \begin{macrocode}
 %</2ekernel>
 %<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2020/10/01}%
-%<latexrelease>                 {\refstepcounter}{Add \@currentcounter}%
+%<latexrelease>\IncludeInRelease{2022/06/01}%
+%<latexrelease>                 {\Ref}{Add starred version}%
 %    \end{macrocode}
 %
 %  \begin{macro}{\refstepcounter}
@@ -373,9 +405,14 @@
 %    normal \texttt{\textbackslash ref} which might spoil kerning.
 %    Perhaps one day this needs redoing.}
 %  \changes{v1.1l}{2019/08/22}{Commanded moved from \texttt{varioref.sty}}
+%  \changes{v1.1p}{2022/04/12}{Macro reimplemented with a starred version}%
 %    \begin{macrocode}
-\DeclareRobustCommand\Ref[1]{\protected at edef\@tempa{\ref{#1}}%
-   \expandafter\MakeUppercase\@tempa}
+\def\@kernel at Ref#1{\protected at edef\@tempa{\@kernel at ref{#1}}%
+       \expandafter\MakeUppercase\@tempa}
+\def\@kernel at sRef#1{\protected at edef\@tempa{\@kernel at sref{#1}}%
+       \expandafter\MakeUppercase\@tempa}
+\NewDocumentCommand\Ref{s}
+   {\IfBooleanTF{#1}{\@kernel at sRef}{\@kernel at Ref}}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -385,6 +422,18 @@
 %    \begin{macrocode}
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2022/06/01}%
+%<latexrelease>                 {\Ref}{Add starred version}%
+%<latexrelease>\def\@currentcounter{}
+%<latexrelease>\def\refstepcounter#1{\stepcounter{#1}%
+%<latexrelease>    \edef\@currentcounter{#1}%
+%<latexrelease>    \protected at edef\@currentlabel
+%<latexrelease>       {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}%
+%<latexrelease>}
+%<latexrelease>\def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1}
+%<latexrelease>\DeclareRobustCommand\Ref[1]{\protected at edef\@tempa{\ref{#1}}%
+%<latexrelease>   \expandafter\MakeUppercase\@tempa}
+%<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{2019/10/01}%
 %<latexrelease>                 {\refstepcounter}{Add \labelformat and \Ref}%
 %<latexrelease>\let\@currentcounter\@undefined
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index db7a495a..51e0858a 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,6 +5,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2022-04-12  Ulrike Fischer  <Ulrike.Fischer at latex-project.org>
+
+	* showkeys.dtx: Adapt to starred references, update varioref support.
+      Added rollback to 2014-10-28
+
 2022-01-05  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* bm.dtx: Guard \nolimits@ for gh issue 744
diff --git a/required/tools/showkeys-2014-10-28.sty b/required/tools/showkeys-2014-10-28.sty
new file mode 100644
index 00000000..b4d7b190
--- /dev/null
+++ b/required/tools/showkeys-2014-10-28.sty
@@ -0,0 +1,272 @@
+%%
+%% This is file `showkeys.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% showkeys.dtx  (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% The source is maintained by the LaTeX Project team and bug
+%% reports for it can be opened at https://latex-project.org/bugs/
+%% (but please observe conditions on bug reports sent to that address!)
+%%
+%%
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
+%% in this file.
+%%
+%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
+%% --------------------------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This file may only be distributed together with a copy of the LaTeX
+%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
+%% without such generated files.
+%%
+%% The list of all files belonging to the LaTeX `Tools Bundle' is
+%% given in the file `manifest.txt'.
+%%
+%% File: showkeys.dtx Copyright (C) 1992-1997 David Carlisle
+%% File: showkeys.dtx Copyright (C) 2006-2019 David Carlisle, LaTeX Project
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{showkeys}
+          [2014/10/28 v3.17 Show cite and label keys (DPC, MH)]
+\DeclareOption{notref}{\let\SK at ref\@empty}
+\DeclareOption{notcite}{\let\SK at cite\@empty}
+\let\SK at refcolor\relax
+\let\SK at labelcolor\relax
+\DeclareOption{color}{\AtEndOfPackage{%
+  \RequirePackage{color}%
+  \definecolor{refkey}{gray}{.75}%
+  \definecolor{labelkey}{gray}{.75}%
+  \def\SK at refcolor{\color{refkey}}%
+  \def\SK at labelcolor{\color{labelkey}}}}
+\DeclareOption{final}{%
+  \providecommand*\showkeyslabelformat[1]{}%
+  \endinput}
+\DeclareOption{draft}{}
+\ProcessOptions
+\let\SK at label\label
+\let\SK at bibitem\@bibitem
+\let\SK at lbibitem\@lbibitem
+\def\label#1{%
+  \@bsphack
+  \SK@\SK@@label{#1}%
+  \begingroup
+    \SK at label{#1}%
+  \endgroup
+  \@esphack}
+\def\@bibitem#1{%
+  \SK at bibitem{#1}\SK@\SK@@label{#1}\ignorespaces}
+\def\@lbibitem[#1]#2{%
+  \SK at lbibitem[{#1}]{#2}\SK@\SK@@label{#2}\ignorespaces}
+\def\SK@#1#2{%
+  \protected at edef\@tempa{#2}%
+  \expandafter#1\meaning\@tempa\SK@}
+\providecommand*\showkeyslabelformat[1]{%
+  \fbox{\normalfont\small\ttfamily#1}}
+\def\SK@@label#1>#2\SK@{%
+  \gdef\SK at lab{\smash{\SK at labelcolor\showkeyslabelformat{#2}}}%
+  \ifvmode
+    \if at inlabel
+      \global\setbox\@labels\hbox{%
+        \llap{\SK at lab\SK at lab@relax
+              \kern\@totalleftmargin\kern\marginparsep}%
+        \box\@labels}%
+    \else
+      \dimen@\prevdepth
+      \nointerlineskip
+      \ifinner
+        \skip@\lastskip\unskip
+        \advance\skip@\lastskip\unskip
+        \setbox\z@\lastbox
+        \ifvoid\z@
+          \llap{\SK at lab\SK at lab@relax\kern\marginparsep}%
+        \else
+          \hbox{\box\z@\rlap{\kern\marginparsep\SK at labx}}%
+        \fi
+        \vskip\skip@
+      \else
+        \llap{\SK at lab\SK at lab@relax\kern\marginparsep}%
+      \fi
+      \prevdepth\dimen@
+    \fi
+  \else
+    \csname SK@\@currenvir\endcsname
+    \ifSK at equation\else
+      \ifmmode
+        \SK at labx
+      \else
+        \ifinner
+          \rlap\SK at lab
+      \else
+          \vadjust{\llap{\SK at lab\kern\marginparsep}}%
+        \fi
+        \SK at lab@relax
+      \fi
+    \fi
+  \fi}
+\AtBeginDocument{%
+  \let\SK at eqnnum\@eqnnum
+  \@ifpackageloaded{amsmath}{%
+    \let\SK at tagform@\tagform@
+    \let\SK at maketag@@@\maketag@@@
+    \iftagsleft@
+      \def\tagform@#1{%
+        \ifx\df at label\@empty
+          \SK at lab@relax
+        \else
+          \expandafter\SK@@label\meaning\df at label\SK@
+        \fi
+        \llap{\SK at lab\kern\marginparsep}%
+        \SK at lab@relax\SK at tagform@{#1}}%
+      \def\maketag@@@#1{%
+        \ifx\df at label\@empty
+          \SK at lab@relax
+        \else
+          \expandafter\SK@@label\meaning\df at label\SK@
+        \fi
+        \llap{\SK at lab\kern\marginparsep}\SK at lab@relax
+        \SK at maketag@@@{#1}%
+      }%
+      \def\@eqnnum{%
+        \llap{\SK at lab\kern\displaywidth\kern\marginparsep}%
+        \SK at lab@relax\SK at eqnnum}%
+    \else
+      \def\tagform@#1{%
+        \ifx\df at label\@empty
+          \SK at lab@relax
+        \else
+          \expandafter\SK@@label\meaning\df at label\SK@
+        \fi
+        \SK at tagform@{#1}%
+        \rlap{\kern\marginparsep\SK at lab}\SK at lab@relax}%
+      \def\maketag@@@#1{%
+        \ifx\df at label\@empty
+          \SK at lab@relax
+        \else
+          \expandafter\SK@@label\meaning\df at label\SK@
+        \fi
+        \SK at maketag@@@{#1}%
+        \rlap{\kern\marginparsep\SK at lab}\SK at lab@relax
+      }%
+      \def\@eqnnum{\SK at eqnnum\rlap{\kern\marginparsep\SK at lab}%
+        \SK at lab@relax}%
+    \fi
+  }%
+  {%
+    \@ifundefined{ver at leqno.clo}{%
+      \def\@eqnnum{\SK at eqnnum\rlap{\kern\marginparsep\SK at lab}%
+        \SK at lab@relax}%
+    }{%
+      \def\@eqnnum{%
+        \llap{\SK at lab\kern\displaywidth\kern\marginparsep}%
+        \SK at lab@relax\SK at eqnnum}%
+    }%
+  }%
+}
+\def\SK at labx{\rlap\SK at lab\global\let\SK at lab\relax}
+\def\SK at lab@relax{\global\let\SK at lab\relax}\SK at lab@relax
+\newif\ifSK at equation
+\let\SK at equation\SK at equationtrue
+\let\SK at eqnarray\SK at equationtrue
+\toks@\expandafter{\eqnarray}
+\edef\eqnarray{\let\noexpand\tagform@\noexpand\SK at tagform@\the\toks@}
+\let\SK at align\SK at equationtrue
+\let\SK at alignat\SK at equationtrue
+\let\SK at xalignat\SK at equationtrue
+\let\SK at xxalignat\SK at equationtrue
+\let\SK at gather\SK at equationtrue
+\let\SK at multline\SK at equationtrue
+\let\SK at flalign\SK at equationtrue
+\expandafter\let\csname SK at align*\endcsname\SK at equationtrue
+\expandafter\let\csname SK at alignat*\endcsname\SK at equationtrue
+\expandafter\let\csname SK at flalign*\endcsname\SK at equationtrue
+\expandafter\let\csname SK at gather*\endcsname\SK at equationtrue
+\expandafter\let\csname SK at multline*\endcsname\SK at equationtrue
+\expandafter\let\csname SK at equation*\endcsname\SK at equationtrue
+\def\SK at def#1{%
+  \edef\@tempa{\expandafter\@gobble\string#1}%
+  \@ifundefined{\@tempa\space}%
+    {\expandafter\let\csname SK@\@tempa\endcsname#1}%
+    {\expandafter\let\csname SK@\@tempa\expandafter\endcsname
+                         \csname\@tempa\space\endcsname}%
+  \expandafter\def\expandafter#1\expandafter{%
+        \expandafter\protect\csname\@tempa\space\endcsname}%
+  \expandafter\def\csname\@tempa\space\endcsname}
+\ifx\SK at ref\@empty
+\AtBeginDocument{%
+  \@ifpackageloaded{varioref}{%
+    \SK at def\@@vpageref#1[#2]#3{{%
+      \let\label\SK at label
+      \SK@@@vpageref{#1}[{#2}]{#3}}}%
+    \def\vr at f#1{%
+      \leavevmode\unskip\vref at space
+      \ref{#1}%
+      {\let\label\SK at label
+      \vpageref[\unskip]{#1}}}%
+  }{}}
+\else
+\AtBeginDocument{%
+  \SK at def\ref#1{\SK@\SK@@ref{#1}\SK at ref{#1}}%
+  \SK at def\pageref#1{\SK@\SK@@ref{#1}\SK at pageref{#1}}%
+  \@ifpackageloaded{varioref}{%
+    \SK at def\@@vpageref#1[#2]#3{{%
+      \let\label\SK at label\let\ref\SK at ref\let\pageref\SK at pageref
+      \leavevmode\unskip\SK@\SK@@ref{#3}\SK@@@vpageref{#1}[{#2}]{#3}}}%
+    \def\vr at f#1{%
+      \leavevmode\unskip\vref at space
+      \ref{#1}%
+      \let\label\SK at label\let\ref\SK at ref\let\pageref\SK at pageref
+      \vpageref[\unskip]{#1}}%
+  }{}}
+\fi
+\ifx\SK at cite\@empty
+\AtBeginDocument{%
+  \ifx\HAR at checkdef\@undefined\else
+      \expandafter\let\expandafter
+         \SK at HAR@bi\csname\string\harvarditem\endcsname
+      \expandafter\def\csname\string\harvarditem\endcsname[#1]#2#3#4{%
+        \SK at HAR@bi[{#1}]{#2}{#3}{#4}\SK@\SK@@label{#4}}%
+  \fi}
+\else
+\AtBeginDocument{%
+  \ifx\HAR at checkdef\@undefined
+    \ifx\citen\@undefined
+      \SK at def\@citex[#1]#2{\SK at citex[{#1}]{#2}}%
+    \else
+      \SK at def\citen#1{\SK@\SK@@ref{#1}\SK at citen{#1}}%
+    \fi
+    \SK at def\citeauthor#1{\SK@\SK@@ref{#1}\SK at citeauthor{#1}}%
+    \SK at def\citefullauthor#1{\SK@\SK@@ref{#1}\SK at citefullauthor{#1}}%
+    \SK at def\citeyear#1{\SK@\SK@@ref{#1}\SK at citeyear{#1}}%
+  \else
+    \SK at def\HAR at checkdef#1#2{%
+      \expandafter\SK@\expandafter\SK@@ref\expandafter{#1}%
+      \SK at HAR@checkdef{#1}{#2}}%
+      \expandafter\let\expandafter
+         \SK at HAR@bi\csname\string\harvarditem\endcsname
+      \expandafter\def\csname\string\harvarditem\endcsname[#1]#2#3#4{%
+        \SK at HAR@bi[{#1}]{#2}{#3}{#4}\SK@\SK@@label{#4}}%
+  \fi}
+\def\SK at citex[#1]#2{%
+  \SK@\SK@@ref{#2}\SK@@citex[{#1}]{#2}}
+\fi
+\def\SK@@ref#1>#2\SK@{%
+  \leavevmode\vbox to\z@{{%
+    \vss
+    \SK at refcolor
+    \rlap{\vrule\raise .75em%
+       \hbox{\underbar{\normalfont\footnotesize\ttfamily#2}}}}}}
+\endinput
+%%
+%% End of file `showkeys.sty'.
diff --git a/required/tools/showkeys.dtx b/required/tools/showkeys.dtx
index 959b5c62..3aed90d3 100644
--- a/required/tools/showkeys.dtx
+++ b/required/tools/showkeys.dtx
@@ -28,11 +28,18 @@
           \ProvidesFile{showkeys.dtx}
 %</dtx>
 %<package>\NeedsTeXFormat{LaTeX2e}
+%<package>
+%<package>\providecommand\DeclareRelease[3]{}
+%<package>\providecommand\DeclareCurrentRelease[2]{}
+%<package>
+%<package>\DeclareRelease{}{2014-10-28}{showkeys-2014-10-28.sty}
+%<package>\DeclareCurrentRelease{}{2022-06-01}
+%<package>
 %<package>\ProvidesPackage{showkeys}
 %<driver> \ProvidesFile{showkeys.drv}
 % \fi
 %         \ProvidesFile{showkeys.dtx}
-          [2014/10/28 v3.17 Show cite and label keys (DPC, MH)]
+          [2022/04/12 v3.18 Show cite and label keys (DPC, MH)]
 %
 % \iffalse
 %<*driver>
@@ -70,7 +77,8 @@
 %         {Support harvard, varioref and natbib packages,}
 % \changes{v3.02}{1995/03/17}
 %         {Support new AMS files}
-%
+% \changes{v3.18}{2022/04/12}
+%         {Support starred references}
 % \section{Introduction}\label{sec:intro}
 %
 % |showkeys.sty| modifies the |\label|, |\ref|, |\pageref|, |\cite|, and
@@ -749,18 +757,10 @@
 % \changes{v3.13}{2006/01/09}{Updated varioref support, for latex/3373}
 % \changes{v3.15}{2006/06/19}
 %         {Prevent loss of brackets}
+% \changes{v3.18}{2022/04/12}
+%         {update varioref support: it no longer uses label, so no patch
+%         needed if notref is used.}
 %    \begin{macrocode}
-\AtBeginDocument{%
-  \@ifpackageloaded{varioref}{%
-    \SK at def\@@vpageref#1[#2]#3{{%
-      \let\label\SK at label
-      \SK@@@vpageref{#1}[{#2}]{#3}}}%
-    \def\vr at f#1{%
-      \leavevmode\unskip\vref at space
-      \ref{#1}%
-      {\let\label\SK at label
-      \vpageref[\unskip]{#1}}}%
-  }{}}
 \else
 %    \end{macrocode}
 %
@@ -775,22 +775,26 @@
 %      {Make redefinition conditional on notref option}
 % \changes{v3.15}{2006/06/19}
 %         {Prevent loss of brackets}
+% \changes{v3.18}{2022/04/12}
+%         {support new kernel commands with starred versions}
+% \changes{v3.18}{2022/04/12}
+%         {update varioref support: it no longer uses label}
 %    \begin{macrocode}
 \AtBeginDocument{%
-  \SK at def\ref#1{\SK@\SK@@ref{#1}\SK at ref{#1}}%
-  \SK at def\pageref#1{\SK@\SK@@ref{#1}\SK at pageref{#1}}%
+  \let\@kernel at ref@\@kernel at ref
+  \let\@kernel at sref@\@kernel at sref
+  \SK at def\@kernel at ref#1{\SK@\SK@@ref{#1}\SK@@kernel at ref{#1}}%
+  \SK at def\@kernel at sref#1{\SK@\SK@@ref{#1}\SK@@kernel at sref{#1}}%
+  \SK at def\@kernel at pageref#1{\SK@\SK@@ref{#1}\SK@@kernel at pageref{#1}}%
+  \SK at def\@kernel at spageref#1{\SK@\SK@@ref{#1}\SK@@kernel at spageref{#1}}%
+  \SK at def\@kernel at Ref#1{{\let\@kernel at ref\@kernel at ref@\SK@\SK@@ref{#1}\SK@@kernel at Ref{#1}}}%
+  \SK at def\@kernel at sRef#1{\let\@kernel at sref\@kernel at sref@\SK@\SK@@ref{#1}\SK@@kernel at sRef{#1}}%
 %    \end{macrocode}
 % varioref support.
 %    \begin{macrocode}
   \@ifpackageloaded{varioref}{%
     \SK at def\@@vpageref#1[#2]#3{{%
-      \let\label\SK at label\let\ref\SK at ref\let\pageref\SK at pageref
-      \leavevmode\unskip\SK@\SK@@ref{#3}\SK@@@vpageref{#1}[{#2}]{#3}}}%
-    \def\vr at f#1{%
-      \leavevmode\unskip\vref at space
-      \ref{#1}%
-      \let\label\SK at label\let\ref\SK at ref\let\pageref\SK at pageref
-      \vpageref[\unskip]{#1}}%
+      \leavevmode\unskip\SK@\SK@@ref{#3}\SK@@@vpageref{#1}[{#2}]{#3}}}%%
   }{}}
 %    \end{macrocode}
 %





More information about the latex3-commits mailing list.