[latex3-commits] [git/LaTeX3-latex3-latex2e] gh300: add \@currentcounter to \refstepcounter, issue #300 (1741bfe6)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu May 7 15:46:44 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh300
Link       : https://github.com/latex3/latex2e/commit/1741bfe6d3a7e8fcd18c7f5adb0f21cec4640f01

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

commit 1741bfe6d3a7e8fcd18c7f5adb0f21cec4640f01
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu May 7 15:46:44 2020 +0200

    add \@currentcounter to \refstepcounter, issue #300


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

1741bfe6d3a7e8fcd18c7f5adb0f21cec4640f01
 base/changes.txt                                   | 60 +++++-----------------
 base/doc/ltnews32.tex                              |  6 +++
 base/ltxref.dtx                                    | 18 +++++--
 ...hub-0124.lvt => github-0300-currentcounter.lvt} |  7 ++-
 base/testfiles/github-0300-currentcounter.tlg      |  6 +++
 ...-0327-rollback.lvt => github-0300-rollback.lvt} | 13 +----
 .../github-0300-rollback.tlg}                      |  8 ++-
 7 files changed, 48 insertions(+), 70 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 3621c93f..b3d6294c 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -1,56 +1,14 @@
-================================================================================
-This file lists changes to the LaTeX2e files in reverse chronological order of
-publication (therefore the dates might be out of sequence if there are hotfixes).
-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.
-================================================================================
-
-2020-05-02  Johannes Braams  <texniek at braams.xs4all.nl>
+2020-05-07  Ulrike Fischer <Ulrike.Fischer at latex-project.org>
 
-	* ltexpl.dtx: Created aliases for two expl3 macros in order to use
-	them to remove leading and trailing spaces from filenames (gh/217)
-
-2020-05-02  Johannes Braams  <texniek at braams.xs4all.nl>
-
-	* ltfiles.dtx: Modified \include and \includeony to support
-	filenames with spaces in them (gh/217)
-
-2020-04-29  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
-
-	* lttextcomp.dtx (subsection{Sub-encoding 2}):
-	Make all captial accents text commands in Unicode engines for
-	hyperref (gh/332)}
-
-2020-04-22  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
-
-	* ltmiscen.dtx (subsection{Verbatim}):
-	Drop spaces before \verb delimiter (gh/327)
+	* ltxref.dtx:
+	added \@currentcounter to \refstepcounter (gh/300)
 
-2020-04-22  Ulrike Fischer  <Ulrike.Fischer at latex-project.org>
+2020-04-22  Ulrike Fischer <Ulrike.Fischer at latex-project.org>
 
 	* ltoutenc.dtx (tuenc.def):
 	corrected unicode value of \=y from "0232 to "0233
 
-2020-04-22  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
-
-	* ltspace.dtx (subsection{The code}):
-	Support calc syntax for \newline (gh/152)
-	Support calc syntax for \addvspace (gh/152)
-
-	* lttab.dtx (subsection{tabbing}):
-	Support calc syntax in tabbing (gh/152)
-
-	* ltpictur.dtx (section{Picture Mode}):
-	Support calc syntax in \shortstack (gh/152)
-
-	* ltmiscen.dtx (subsection{Center, Flushright, Flushleft}):
-	Support calc syntax for \\  (gh/152)
-
-	* ltmath.dtx (subsection{Math Environments}):
-	Support calc syntax for \\  (gh/152)
-
-2020-04-21  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+2020-04-21  Frank Mittelbach <Frank.Mittelbach at latex-project.org>
 
 	* ltspace.dtx (subsection{Horizontal space (and breaks)}):
 	Support calc syntax with \hspace (gh/152)
@@ -105,6 +63,14 @@ are not part of the distribution.
 	* ltmath.dtx (subsubsection{The UNSORTED Rest}):
 	Add \texttt{amsmath} math/text spacing commands to the kernel (gh/303)
 
+================================================================================
+This file lists changes to the LaTeX2e files in reverse chronological order of
+publication (therefore the dates might be out of sequence if there are hotfixes).
+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.
+================================================================================
+
 2020-03-08  Johannes Braams  <texniek at braams.xs4all.nl>
 
 	* letter.dtx: merged changes to classes.dtx into letter.dtx
diff --git a/base/doc/ltnews32.tex b/base/doc/ltnews32.tex
index fe11844a..3796b23a 100644
--- a/base/doc/ltnews32.tex
+++ b/base/doc/ltnews32.tex
@@ -401,6 +401,12 @@ are ignored as elsewhere.
 \githubissue{327}
 
 
+\subsection{Record the counter name stepped by \cs{refstepcounter}}
+\cs{refstepcounter} now stores the name of counter in \cs{\@currentcounter}. 
+This allows packages like \pkg{zref} and \pkg{hyperref} to store the name without
+having to patch \cs{refstepcounter}.
+%
+\githubissue{300}
 
 
 \section{Changes to packages in the \pkg{graphics} category}
diff --git a/base/ltxref.dtx b/base/ltxref.dtx
index c20a3245..98187571 100644
--- a/base/ltxref.dtx
+++ b/base/ltxref.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltxref.dtx}
-             [2019/09/16 v1.1m LaTeX Kernel (Cross Referencing)]
+             [2020/05/07 v1.1n LaTeX Kernel (Cross Referencing)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltxref.dtx}
@@ -311,14 +311,16 @@
 %    \begin{macrocode}
 %</2ekernel>
 %<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2019/10/01}%
-%<latexrelease>                 {\refstepcounter}{Add \labelformat and \Ref}%
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>                 {\refstepcounter}{Add \@currentcounter}%
 %    \end{macrocode}
 %
 %  \begin{macro}{\refstepcounter}
 %     Step the counter and allow for labels to point to its current value.
+%  \changes{v1.1n}{2020/05/05}{record the counter name in \cs{@currentcounter}}
 %    \begin{macrocode}
 \def\refstepcounter#1{\stepcounter{#1}%
+    \edef\@currentcounter{#1}%
     \protected at edef\@currentlabel
 %    \end{macrocode}
 %    By generating the second csname first the |\p at ...| command can
@@ -381,6 +383,16 @@
 %    \begin{macrocode}
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease>                 {\refstepcounter}{Add \labelformat and \Ref}%
+%<latexrelease>\def\refstepcounter#1{\stepcounter{#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{0000/00/00}%
 %<latexrelease>                 {\refstepcounter}{Add \labelformat and \Ref}%
 %<latexrelease>
diff --git a/base/testfiles/github-0124.lvt b/base/testfiles/github-0300-currentcounter.lvt
similarity index 57%
copy from base/testfiles/github-0124.lvt
copy to base/testfiles/github-0300-currentcounter.lvt
index be32ece1..66a925f0 100644
--- a/base/testfiles/github-0124.lvt
+++ b/base/testfiles/github-0300-currentcounter.lvt
@@ -1,11 +1,10 @@
 \documentclass{article}
-
 \input{test2e}
 
 \begin{document}
 
 \START
-
-  \symbol{"1D400}
-
+\refstepcounter{section}
+\makeatletter\show\@currentcounter
 \end{document}
+
diff --git a/base/testfiles/github-0300-currentcounter.tlg b/base/testfiles/github-0300-currentcounter.tlg
new file mode 100644
index 00000000..28eccc92
--- /dev/null
+++ b/base/testfiles/github-0300-currentcounter.tlg
@@ -0,0 +1,6 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \@currentcounter=macro:
+->section.
+l. ...\makeatletter\show\@currentcounter
+(github-0300-currentcounter.aux)
diff --git a/base/testfiles/github-0327-rollback.lvt b/base/testfiles/github-0300-rollback.lvt
similarity index 51%
copy from base/testfiles/github-0327-rollback.lvt
copy to base/testfiles/github-0300-rollback.lvt
index 3441373c..987a8829 100644
--- a/base/testfiles/github-0327-rollback.lvt
+++ b/base/testfiles/github-0300-rollback.lvt
@@ -3,19 +3,10 @@
 \documentclass{article}
 \input{test2e}
 
-\showoutput
-
 \begin{document}
 
 \START
-
-\verb|~ ~| W \verb|~|
-
-\verb |~ ~| X \verb |~|
-
-\verb* |~ ~| Y \verb* |~|
-
-\verb*  |~ ~| Z \verb*  |~|
-
+\refstepcounter{section}
+\makeatletter\show\@currentcounter
 \end{document}
 
diff --git a/base/testfiles-TU/tu-tlb4500.tlg b/base/testfiles/github-0300-rollback.tlg
similarity index 50%
copy from base/testfiles-TU/tu-tlb4500.tlg
copy to base/testfiles/github-0300-rollback.tlg
index 6c7661c3..1f45bdc0 100644
--- a/base/testfiles-TU/tu-tlb4500.tlg
+++ b/base/testfiles/github-0300-rollback.tlg
@@ -1,7 +1,5 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-> \box...=
-\hbox(7.5+2.49998)x45.84
-.\TU/lmr/m/n/10 $<>\_{|}
-! OK.
-l. ...\showbox0
+> \@currentcounter=undefined.
+l. ...\makeatletter\show\@currentcounter
+(github-0300-rollback.aux)





More information about the latex3-commits mailing list.