[latex3-commits] [git/LaTeX3-latex3-latex2e] varioref: define \labelformat and \Ref when running on an older kernel (cfa825d2)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Aug 30 18:56:24 CEST 2019


Repository : https://github.com/latex3/latex2e
On branch  : varioref
Link       : https://github.com/latex3/latex2e/commit/cfa825d2383db48c06444d5717679aa7c5b9f5cf

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

commit cfa825d2383db48c06444d5717679aa7c5b9f5cf
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Aug 30 18:56:24 2019 +0200

    define \labelformat and \Ref when running on an older kernel


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

cfa825d2383db48c06444d5717679aa7c5b9f5cf
 required/tools/varioref.dtx | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/required/tools/varioref.dtx b/required/tools/varioref.dtx
index 18397b27..47a2cc69 100644
--- a/required/tools/varioref.dtx
+++ b/required/tools/varioref.dtx
@@ -2335,6 +2335,33 @@
 %    \end{macrocode}
 %  \end{macro}
 %
+%
+%
+%  \subsubsection{Compatibility with older \LaTeX{} formats}
+%
+%
+%  \begin{macro}{\labelformat}
+%  \begin{macro}{\Ref}
+%  \begin{macro}{\refstepcounter}
+%    We don't need to define \cs{labelformat} and \cs{Ref} or change the
+%    definition of \cs{refstepcounter} any longer because this is now
+%    done in the \LaTeX{} kernel. However, if this package is used
+%    together with an older kernel, this is not true, so for this
+%    special case we keep the definitions.
+%    \begin{macrocode}
+\ifx\labelformat\@undefined  % assume we are in an older kernel
+  \def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1}
+  \DeclareRobustCommand\Ref[1]{\protected at edef\@tempa{\ref{#1}}%
+     \expandafter\MakeUppercase\@tempa}
+  \def\refstepcounter#1{\stepcounter{#1}%
+      \protected at edef\@currentlabel
+         {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}}
+\fi
+%    \end{macrocode}
+%  \end{macro}
+%  \end{macro}
+%  \end{macro}
+%
 %    \begin{macrocode}
 %</package>
 %    \end{macrocode}





More information about the latex3-commits mailing list