[latex3-commits] [git/LaTeX3-latex3-latex2e] master: added \@removefromreset, \counterwithin and \counterwithout (8593e7c)

Frank Mittelbach frank.mittelbach at latex-project.org
Thu Mar 8 19:30:58 CET 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/8593e7cdee506670871beef45d5437179f859028

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

commit 8593e7cdee506670871beef45d5437179f859028
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Mar 8 19:30:58 2018 +0100

    added \@removefromreset, \counterwithin and \counterwithout


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

8593e7cdee506670871beef45d5437179f859028
 base/changes.txt                    |    5 ++
 base/ltcounts.dtx                   |  133 +++++++++++++++++++++++++++-
 base/testfiles/tlb-remreset-001.lvt |   81 +++++++++++++++++
 base/testfiles/tlb-remreset-001.tlg |   78 ++++++++++++++++
 base/testfiles/tlb-remreset-002.lvt |   96 ++++++++++++++++++++
 base/testfiles/tlb-remreset-002.tlg |  166 +++++++++++++++++++++++++++++++++++
 base/testfiles/tlb-remreset-003.lvt |   96 ++++++++++++++++++++
 base/testfiles/tlb-remreset-003.tlg |  166 +++++++++++++++++++++++++++++++++++
 8 files changed, 819 insertions(+), 2 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index abfe5f5..80f889e 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2018-03-08  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltcounts.dtx: added \@removefromreset, \counterwithin and
+	\counterwithout
+
 2018-02-01    <Frank.Mittelbach at latex-project.org>
 
 	* doc.dtx: Only use\DocStyleParms if defined
diff --git a/base/ltcounts.dtx b/base/ltcounts.dtx
index 8bcb56f..bf370bf 100644
--- a/base/ltcounts.dtx
+++ b/base/ltcounts.dtx
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright 1993-2016
+% Copyright 1993-2018
 % The LaTeX3 Project and any individual authors listed elsewhere
 % in this file.
 %
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltcounts.dtx}
-             [2015/06/05 v1.1j LaTeX Kernel (Counters)]
+             [2018/03/08 v1.1k LaTeX Kernel (Counters)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltcounts.dtx}
@@ -105,6 +105,22 @@
 % |\fnsymbol|\marg{counter}:  $*$, $\dagger$, $\ddagger$, \ldots
 %
 %
+% \DescribeMacro\counterwithin
+% |\counterwithin|\marg{counter}\marg{within-counter}:
+% Resets \meta{counter} when \meta{within-counter} is stepped. Also
+% redefines |\the|\meta{counter} command to produce
+% |\the|\meta{within-counter}|.\arabic|\marg{counter}.
+% Star form omits redefining the print representation.
+
+%
+% \DescribeMacro\counterwithout
+% |\counterwithout|\marg{counter}\marg{within-counter}:
+% Removes \meta{counter} from the reset list of \meta{within-counter}.
+% Also
+% redefines |\the|\meta{counter} command to produce
+% |\arabic|\marg{counter}.
+% Star form omits redefining the print representation.
+%
 % \StopEventually{}
 %
 %    \begin{macrocode}
@@ -167,6 +183,10 @@
 %          Adds counter \meta{foo} to the list of counters
 %         |\cl at bar| to be reset  when counter \meta{bar} is stepped.
 %
+%    |\@removefromreset|\marg{foo}\marg{bar} :
+%          Removes counter \meta{foo} to the list of counters
+%         |\cl at bar| to be reset  when counter \meta{bar} is stepped.
+%
 %
 % \begin{macro}{\setcounter}
 % \changes{v1.0d}{1994/04/09}
@@ -302,6 +322,115 @@
 %  \end{macro}
 %
 %    
+%    \begin{macrocode}
+%</2ekernel>
+%    \end{macrocode}
+%
+%
+% \begin{macro}{\@removefromreset}
+%    \changes{v1.1k}{2018/03/08}{Interface added}
+%    \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2018/03/01}{\@removefromreset}{Add interfaces}%
+%<*2ekernel|latexrelease>
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\def\@removefromreset#1#2{%
+  \@ifundefined{c@#2}\relax
+  {{\expandafter\let\csname c@#1\endcsname\@removefromreset
+    \def\@elt##1{%
+      \expandafter\ifx\csname c@##1\endcsname\@removefromreset
+      \else
+        \noexpand\@elt{##1}%
+      \fi}%
+    \expandafter\xdef\csname cl@#2\endcsname
+     {\csname cl@#2\endcsname}}}}
+%    \end{macrocode}
+%  \end{macro}
+
+
+
+%  \begin{macro}{\@ifbothcounters}
+%    \changes{v1.1k}{2018/03/08}{Interface added}
+%    Test if arg |#1| and |#2| are counters and if so execute |#3|.
+%    \begin{macrocode}
+\def\@ifbothcounters#1#2#3{%
+  \@ifundefined{c@#1}{\@nocounterr{#1}}%
+    {% else counter is defined
+     \@ifundefined{c@#2}{\@nocounterr{#2}}%
+       {% else both counter and within  are defined
+        #3}}}
+%    \end{macrocode}
+%  \end{macro}
+
+
+%  \begin{macro}{\counterwithout}
+%    
+%    \changes{v1.1k}{2018/03/08}{Interface added}
+%    \begin{macrocode}
+\def\counterwithout {\@ifstar\counterwithout at s\counterwithout at x}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\def\counterwithout at s#1#2{%
+  \@ifbothcounters{#1}{#2}{\@removefromreset{#1}{#2}}}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\def\counterwithout at x#1#2{%
+  \@ifbothcounters{#1}{#2}%
+      {\@removefromreset{#1}{#2}%
+       \expandafter
+       \gdef\csname the#1\expandafter\endcsname\expandafter
+            {\expandafter
+             \@arabic\csname c@#1\endcsname}}}
+%    \end{macrocode}
+%  \end{macro}
+
+
+
+%  \begin{macro}{\counterwithin}
+%    
+%    \changes{v1.1k}{2018/03/08}{Interface added}
+%    \begin{macrocode}
+\def\counterwithin{\@ifstar\counterwithin at s\counterwithin at x}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\def\counterwithin at s#1#2{%
+  \@ifbothcounters{#1}{#2}{\@addtoreset{#1}{#2}}}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\def\counterwithin at x#1#2{%
+  \@ifbothcounters{#1}{#2}%
+      {\@addtoreset{#1}{#2}%
+       \expandafter
+       \gdef\csname the#1\expandafter\endcsname\expandafter
+            {\csname the#2\expandafter\endcsname\expandafter
+             \@arabic\csname c@#1\endcsname}}}
+%    \end{macrocode}
+%  \end{macro}
+
+
+%    
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}{\@removefromreset}{Add interfaces}%
+%<latexrelease>\let \@removefromreset \undefined
+%<latexrelease>\let \@ifbothcounters  \undefined
+%<latexrelease>\let \counterwithout   \undefined
+%<latexrelease>\let \counterwithout at s \undefined
+%<latexrelease>\let \counterwithout at x \undefined
+%<latexrelease>\let \counterwithin    \undefined
+%<latexrelease>\let \counterwithin at s  \undefined
+%<latexrelease>\let \counterwithin at x  \undefined
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+%    \end{macrocode}
+%
+%
 %    Numbering commands for definitions of |\theCOUNTER| and |\list|
 %    arguments.
 %
diff --git a/base/testfiles/tlb-remreset-001.lvt b/base/testfiles/tlb-remreset-001.lvt
new file mode 100644
index 0000000..876f01d
--- /dev/null
+++ b/base/testfiles/tlb-remreset-001.lvt
@@ -0,0 +1,81 @@
+%
+% Check that latexrelease generates no errors,
+% eg from mis-matched \(End)IncludeInRelease
+
+\documentclass{article}
+
+% Input the test macros for LaTeX2e
+\input{test2e}
+\START
+
+\makeatletter
+
+% undefined counters ...
+
+\show\cl at foo
+\show\cl at baz
+\show\cl at footnote
+\show\cl at chapter
+\show\cl at section
+
+\@removefromreset{foo}{baz}
+
+\show\cl at foo  % undefined
+\show\cl at baz  % undefined
+
+\@removefromreset{footnote}{baz}
+
+\show\cl at baz       % undefined
+\show\cl at footnote  % empty
+
+\@removefromreset{chapter}{section}
+
+\show\cl at chapter   % undefined
+\show\cl at section   % resets subsection
+
+
+\show\cl at subsection % resets subsubsection
+
+\@removefromreset{section}{subsection}
+
+\show\cl at subsection % unchanged
+\show\cl at section    % unchanged
+
+\@removefromreset{subsection}{section}
+
+\show\cl at subsection % unchanged
+\show\cl at section    % now empty
+
+
+%%%%%%%%%%%%%%%%%%%%
+
+\@addtoreset{footnote}{subsection}
+
+\show\cl at subsection % footnote added
+
+\@removefromreset{footnote}{subsection}
+
+\show\cl at subsection % footnote removed
+
+
+\@addtoreset{footnot}{subsection}
+
+\show\cl at subsection % footnot added even though counter doesn't exist ???
+
+\@removefromreset{footnot}{subsection}
+
+\show\cl at subsection % footnot removed ???
+
+
+\@addtoreset{footnote}{subsection}
+\@addtoreset{footnote}{subsection}
+\@addtoreset{footnote}{subsection}
+
+\show\cl at subsection % 3 footnote?
+
+\@removefromreset{footnote}{subsection}
+
+\show\cl at subsection % all footnotes removed?
+
+\END
+
diff --git a/base/testfiles/tlb-remreset-001.tlg b/base/testfiles/tlb-remreset-001.tlg
new file mode 100644
index 0000000..b0521da
--- /dev/null
+++ b/base/testfiles/tlb-remreset-001.tlg
@@ -0,0 +1,78 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \cl at foo=undefined.
+l. ...\show\cl at foo
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+> \cl at footnote=macro:
+->.
+l. ...\show\cl at footnote
+> \cl at chapter=undefined.
+l. ...\show\cl at chapter
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+> \cl at foo=undefined.
+l. ...\show\cl at foo
+                   % undefined
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+                   % undefined
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+                        % undefined
+> \cl at footnote=macro:
+->.
+l. ...\show\cl at footnote
+                        % empty
+> \cl at chapter=undefined.
+l. ...\show\cl at chapter
+                        % undefined
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+                        % resets subsection
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % resets subsubsection
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+                         % unchanged
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \cl at section=macro:
+->.
+l. ...\show\cl at section
+                         % now empty
+> \cl at subsection=macro:
+->\@elt {subsubsection}\@elt {footnote}.
+l. ...\show\cl at subsection
+                         % footnote added
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % footnote removed
+> \cl at subsection=macro:
+->\@elt {subsubsection}\@elt {footnot}.
+l. ...\show\cl at subsection
+                         % footnot added even though counter doesn't exist ???
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % footnot removed ???
+> \cl at subsection=macro:
+->\@elt {subsubsection}\@elt {footnote}\@elt {footnote}\@elt {footnote}.
+l. ...\show\cl at subsection
+                         % 3 footnote?
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % all footnotes removed?
diff --git a/base/testfiles/tlb-remreset-002.lvt b/base/testfiles/tlb-remreset-002.lvt
new file mode 100644
index 0000000..1d29c68
--- /dev/null
+++ b/base/testfiles/tlb-remreset-002.lvt
@@ -0,0 +1,96 @@
+%
+% Check that latexrelease generates no errors,
+% eg from mis-matched \(End)IncludeInRelease
+
+\documentclass{article}
+
+% Input the test macros for LaTeX2e
+\input{test2e}
+\START
+
+\makeatletter
+
+% undefined counters ...
+
+\show\cl at foo
+\show\cl at baz
+\show\cl at footnote
+\show\cl at chapter
+\show\cl at section
+
+\counterwithout{foo}{baz}
+
+\show\thefoo  % undefined
+\show\cl at foo  % undefined
+\show\cl at baz  % undefined
+
+\counterwithout{footnote}{baz}
+
+\show\thefootnote  % \arabic{footnote}
+\show\cl at baz       % undefined
+\show\cl at footnote  % empty
+
+\counterwithout{chapter}{section}
+
+\show\thechapter   % undefined
+\show\cl at chapter   % undefined
+\show\cl at section   % resets subsection
+
+
+\show\cl at subsection % resets subsubsection
+
+\show\thesection    % \arabic{section}
+
+\counterwithout{section}{subsection}
+
+\show\thesection    % unchanged as it wasn't on before
+\show\cl at subsection % unchanged
+\show\cl at section    % unchanged
+
+\show\thesubsection % \thesubsection . \arabic{subsubsection}
+
+\counterwithout{subsection}{section}
+
+\show\thesubsection % changed to \arabic{subsection}
+\show\cl at subsection % unchanged
+\show\cl at section    % now empty
+
+
+%%%%%%%%%%%%%%%%%%%%
+
+\counterwithin{footnote}{subsection}
+
+\show\thefootnote   % \thesubsection.\arabic{footnote} 
+\show\cl at subsection % footnote added
+
+\counterwithout{footnote}{subsection}
+
+\show\thefootnote   % back to \arabic{footnote}
+\show\cl at subsection % footnote removed
+
+
+\counterwithin{footnot}{subsection}
+
+\show\thefootnot    % undefined
+\show\cl at subsection % unchanged
+
+\counterwithout{footnot}{subsection}
+
+\show\thefootnot    % undefined
+\show\cl at subsection % unchanged
+
+
+\counterwithin{footnote}{subsection}
+\counterwithin{footnote}{subsection}
+\counterwithin{footnote}{subsection}
+
+\show\thefootnote   % \thesubsection.\arabic{footnote}
+\show\cl at subsection % 3 footnote resets?
+
+\counterwithout{footnote}{subsection}
+
+\show\thefootnote   % \arabic{footnote}
+\show\cl at subsection % all footnotes removed?
+
+\END
+
diff --git a/base/testfiles/tlb-remreset-002.tlg b/base/testfiles/tlb-remreset-002.tlg
new file mode 100644
index 0000000..76eac1e
--- /dev/null
+++ b/base/testfiles/tlb-remreset-002.tlg
@@ -0,0 +1,166 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \cl at foo=undefined.
+l. ...\show\cl at foo
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+> \cl at footnote=macro:
+->.
+l. ...\show\cl at footnote
+> \cl at chapter=undefined.
+l. ...\show\cl at chapter
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+! LaTeX Error: No counter 'foo' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout{foo}{baz}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefoo=undefined.
+l. ...\show\thefoo
+                   % undefined
+> \cl at foo=undefined.
+l. ...\show\cl at foo
+                   % undefined
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+                   % undefined
+! LaTeX Error: No counter 'baz' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout{footnote}{baz}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                        % \arabic{footnote}
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+                        % undefined
+> \cl at footnote=macro:
+->.
+l. ...\show\cl at footnote
+                        % empty
+! LaTeX Error: No counter 'chapter' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout{chapter}{section}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thechapter=undefined.
+l. ...\show\thechapter
+                        % undefined
+> \cl at chapter=undefined.
+l. ...\show\cl at chapter
+                        % undefined
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+                        % resets subsection
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % resets subsubsection
+> \thesection=\long macro:
+->\@arabic \c at section .
+l. ...\show\thesection
+                         % \arabic{section}
+> \thesection=macro:
+->\@arabic \c at section .
+l. ...\show\thesection
+                         % unchanged as it wasn't on before
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+                         % unchanged
+> \thesubsection=\long macro:
+->\thesection .\@arabic \c at subsection .
+l. ...\show\thesubsection
+                         % \thesubsection . \arabic{subsubsection}
+> \thesubsection=macro:
+->\@arabic \c at subsection .
+l. ...\show\thesubsection
+                         % changed to \arabic{subsection}
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \cl at section=macro:
+->.
+l. ...\show\cl at section
+                         % now empty
+> \thefootnote=macro:
+->\thesubsection \@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % \thesubsection.\arabic{footnote}
+> \cl at subsection=macro:
+->\@elt {subsubsection}\@elt {footnote}.
+l. ...\show\cl at subsection
+                         % footnote added
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % back to \arabic{footnote}
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % footnote removed
+! LaTeX Error: No counter 'footnot' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithin{footnot}{subsection}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefootnot=undefined.
+l. ...\show\thefootnot
+                         % undefined
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+! LaTeX Error: No counter 'footnot' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout{footnot}{subsection}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefootnot=undefined.
+l. ...\show\thefootnot
+                         % undefined
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \thefootnote=macro:
+->\thesubsection \@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % \thesubsection.\arabic{footnote}
+> \cl at subsection=macro:
+->\@elt {subsubsection}\@elt {footnote}\@elt {footnote}\@elt {footnote}.
+l. ...\show\cl at subsection
+                         % 3 footnote resets?
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % \arabic{footnote}
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % all footnotes removed?
diff --git a/base/testfiles/tlb-remreset-003.lvt b/base/testfiles/tlb-remreset-003.lvt
new file mode 100644
index 0000000..8651e46
--- /dev/null
+++ b/base/testfiles/tlb-remreset-003.lvt
@@ -0,0 +1,96 @@
+%
+% Check that latexrelease generates no errors,
+% eg from mis-matched \(End)IncludeInRelease
+
+\documentclass{article}
+
+% Input the test macros for LaTeX2e
+\input{test2e}
+\START
+
+\makeatletter
+
+% undefined counters ...
+
+\show\cl at foo
+\show\cl at baz
+\show\cl at footnote
+\show\cl at chapter
+\show\cl at section
+
+\counterwithout*{foo}{baz}
+
+\show\thefoo  % undefined
+\show\cl at foo  % undefined
+\show\cl at baz  % undefined
+
+\counterwithout*{footnote}{baz}
+
+\show\thefootnote  % \arabic{footnote}
+\show\cl at baz       % undefined
+\show\cl at footnote  % empty
+
+\counterwithout*{chapter}{section}
+
+\show\thechapter   % undefined
+\show\cl at chapter   % undefined
+\show\cl at section   % resets subsection
+
+
+\show\cl at subsection % resets subsubsection
+
+\show\thesection    % \arabic{section}
+
+\counterwithout*{section}{subsection}
+
+\show\thesection    % unchanged as it wasn't on before
+\show\cl at subsection % unchanged
+\show\cl at section    % unchanged
+
+\show\thesubsection % \thesubsection . \arabic{subsubsection}
+
+\counterwithout*{subsection}{section}
+
+\show\thesubsection % unchanged (because of *)
+\show\cl at subsection % unchanged
+\show\cl at section    % now empty
+
+
+%%%%%%%%%%%%%%%%%%%%
+
+\counterwithin*{footnote}{subsection}
+
+\show\thefootnote   % \arabic{footnote} (because of *)
+\show\cl at subsection % footnote added
+
+\counterwithout*{footnote}{subsection}
+
+\show\thefootnote   % unchanged (because of *)
+\show\cl at subsection % footnote removed
+
+
+\counterwithin*{footnot}{subsection}
+
+\show\thefootnot    % undefined
+\show\cl at subsection % unchanged
+
+\counterwithout*{footnot}{subsection}
+
+\show\thefootnot    % undefined
+\show\cl at subsection % unchanged
+
+
+\counterwithin*{footnote}{subsection}
+\counterwithin*{footnote}{subsection}
+\counterwithin*{footnote}{subsection}
+
+\show\thefootnote   % \arabic{footnote} (because of *)
+\show\cl at subsection % 3 footnote?
+
+\counterwithout*{footnote}{subsection}
+
+\show\thefootnote   % \arabic{footnote} (because of *)
+\show\cl at subsection % all footnotes removed?
+
+\END
+
diff --git a/base/testfiles/tlb-remreset-003.tlg b/base/testfiles/tlb-remreset-003.tlg
new file mode 100644
index 0000000..a5bbd97
--- /dev/null
+++ b/base/testfiles/tlb-remreset-003.tlg
@@ -0,0 +1,166 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \cl at foo=undefined.
+l. ...\show\cl at foo
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+> \cl at footnote=macro:
+->.
+l. ...\show\cl at footnote
+> \cl at chapter=undefined.
+l. ...\show\cl at chapter
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+! LaTeX Error: No counter 'foo' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout*{foo}{baz}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefoo=undefined.
+l. ...\show\thefoo
+                   % undefined
+> \cl at foo=undefined.
+l. ...\show\cl at foo
+                   % undefined
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+                   % undefined
+! LaTeX Error: No counter 'baz' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout*{footnote}{baz}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                        % \arabic{footnote}
+> \cl at baz=undefined.
+l. ...\show\cl at baz
+                        % undefined
+> \cl at footnote=macro:
+->.
+l. ...\show\cl at footnote
+                        % empty
+! LaTeX Error: No counter 'chapter' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout*{chapter}{section}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thechapter=undefined.
+l. ...\show\thechapter
+                        % undefined
+> \cl at chapter=undefined.
+l. ...\show\cl at chapter
+                        % undefined
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+                        % resets subsection
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % resets subsubsection
+> \thesection=\long macro:
+->\@arabic \c at section .
+l. ...\show\thesection
+                         % \arabic{section}
+> \thesection=\long macro:
+->\@arabic \c at section .
+l. ...\show\thesection
+                         % unchanged as it wasn't on before
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \cl at section=macro:
+->\@elt {subsection}.
+l. ...\show\cl at section
+                         % unchanged
+> \thesubsection=\long macro:
+->\thesection .\@arabic \c at subsection .
+l. ...\show\thesubsection
+                         % \thesubsection . \arabic{subsubsection}
+> \thesubsection=\long macro:
+->\thesection .\@arabic \c at subsection .
+l. ...\show\thesubsection
+                         % unchanged (because of *)
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \cl at section=macro:
+->.
+l. ...\show\cl at section
+                         % now empty
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % \arabic{footnote} (because of *)
+> \cl at subsection=macro:
+->\@elt {subsubsection}\@elt {footnote}.
+l. ...\show\cl at subsection
+                         % footnote added
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % unchanged (because of *)
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % footnote removed
+! LaTeX Error: No counter 'footnot' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithin*{footnot}{subsection}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefootnot=undefined.
+l. ...\show\thefootnot
+                         % undefined
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+! LaTeX Error: No counter 'footnot' defined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\counterwithout*{footnot}{subsection}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+> \thefootnot=undefined.
+l. ...\show\thefootnot
+                         % undefined
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % unchanged
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % \arabic{footnote} (because of *)
+> \cl at subsection=macro:
+->\@elt {subsubsection}\@elt {footnote}\@elt {footnote}\@elt {footnote}.
+l. ...\show\cl at subsection
+                         % 3 footnote?
+> \thefootnote=macro:
+->\@arabic \c at footnote .
+l. ...\show\thefootnote
+                         % \arabic{footnote} (because of *)
+> \cl at subsection=macro:
+->\@elt {subsubsection}.
+l. ...\show\cl at subsection
+                         % all footnotes removed?





More information about the latex3-commits mailing list