[latex3-commits] [git/LaTeX3-latex3-latex2e] starredrefs: use expandable reference commands in ifthenelse (c21a6e14)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Apr 13 19:46:09 CEST 2022


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

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

commit c21a6e142b1ff0aeb8283943e8087f2d607e81aa
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Apr 13 19:46:09 2022 +0200

    use expandable reference commands in ifthenelse


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

c21a6e142b1ff0aeb8283943e8087f2d607e81aa
 base/changes.txt |  5 ++++-
 base/ifthen.dtx  | 15 ++++++++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 867f0399..f7fa9da1 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -5,10 +5,13 @@ 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>
+2022-04-13  Ulrike Fischer <Ulrike.Fischer at latex-project.org>
 
 	* ltxref.dtx:
 	Added starred versions of \ref,\pageref and \Ref
+    Added expandable version for \pageref and \ref
+	* ifthen.dtx:
+	use new expandable version for \pageref and \ref
 
 2022-04-03  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
diff --git a/base/ifthen.dtx b/base/ifthen.dtx
index 0bf54b61..d3604299 100644
--- a/base/ifthen.dtx
+++ b/base/ifthen.dtx
@@ -42,7 +42,7 @@
 %<driver>\ProvidesFile{ifthen.drv}
 % \fi
 %         \ProvidesFile{ifthen.dtx}
-          [2020/11/24 v1.1c Standard LaTeX ifthen package (DPC)]
+          [2022/04/13 v1.1d Standard LaTeX ifthen package (DPC)]
 %
 % \iffalse
 %<*driver>
@@ -80,6 +80,7 @@
 % \changes{v1.0k}{1995/04/25}{Fix `driver' docstrip guards.}
 % \changes{v1.0n}{1997/11/03}{Documentation fix.}
 % \changes{v1.0o}{1998/08/17}{Documentation fix.}
+% \changes{v1.1d}{2022/04/13}{Make reference command locally expandable.}
 %
 % \section{Introduction}
 %
@@ -263,6 +264,14 @@
 % macros expanding to |T| or |F| has been completely replaced by a
 % simpler system using |\iftrue|, which furthermore allows lazy
 % evaluation on the second pass.
+% With a LaTeX 2022/06/01 we have to ensure that |\pageref| is expandable.
+%    \begin{macrocode}
+\@ifl at t@r\fmtversion{2022/06/01}
+  {\def\TE at ref@exp{\let\pageref\@kernel at pageref@exp
+                  \let\ref\@kernel at ref@exp}}
+  {\def\TE at ref@exp{\def\@setref##1##2##3{%
+         \ifx##1\relax\z@\else\expandafter##2##1\fi}}}
+%    \end{macrocode}
 %    \begin{macrocode}
 \long\def\ifthenelse#1{%
 %    \end{macrocode}
@@ -295,11 +304,11 @@
 % \changes{v1.0l}{1996/03/22}
 %      {Use \cs{begingroup} not \cs{bgroup} for latex/2105}
 % \changes{v1.1a}{1999/01/07}{\cs{isundefined} added for /2824}
+% \changes{v1.1d}{2022/04/13}{changed method to make \cs{pageref} and \cs{ref} locally expandable.}
 %    \begin{macrocode}
     \begingroup
         \let\protect\@unexpandable at protect
-        \def\@setref##1##2##3{%
-         \ifx##1\relax\z@\else\expandafter##2##1\fi}%
+        \TE at ref@exp
         \def\value##1{\the\csname c@##1\endcsname}%
         \let\equal\TE at equal \let\(\TE at lparen \let\)\TE at rparen
         \let\isodd\TE at odd \let\lengthtest\TE at length





More information about the latex3-commits mailing list.