From 41d0f7d92ad2b4b82de77fb6adc064ad9023c841 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 8 Mar 2022 21:56:36 +0000 Subject: footmisc (8mar22) (branch) git-svn-id: svn://tug.org/texlive/branches/branch2021.final@62527 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/footmisc/footmisc.dtx | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/footmisc/footmisc.dtx b/Master/texmf-dist/source/latex/footmisc/footmisc.dtx index c3a31d2e6a8..bafdb76df3a 100644 --- a/Master/texmf-dist/source/latex/footmisc/footmisc.dtx +++ b/Master/texmf-dist/source/latex/footmisc/footmisc.dtx @@ -38,7 +38,7 @@ %<+package>\DeclareCurrentRelease{}{2022-02-14} %\ProvidesPackage{footmisc}% %<*!debugins> - [2022/03/07 v6.0c + [2022/03/08 v6.0d % % a miscellany of footnote facilities% %<*dtx> @@ -1865,24 +1865,31 @@ % resets footnotes at each chapter start. As a result the first % footnote on the first page of a chapter starts with 2. We % therefore alter one \LaTeX{} internal if \pkg{perpage} is in use: -% \changes{v6.0c}{2022/03/07}{Fix an issue in perpage packag (gh/03)} +% \changes{v6.0c}{2022/03/07}{Fix an issue in perpage package (gh/03)} +% \changes{v6.0d}{2022/03/07}{Also support optional arg of \cs{MakePerPage} (gh/03)} % \begin{macrocode} \def\@stpelt#1{\global\csname c@#1\endcsname \m@ne \stepcounter{#1}% - \setcounter{#1}{0}% + \pp@fix@MakePerPage{#1}% + } + \def\pp@fix@MakePerPage#1{% + \ifnum \value{#1}>\z@ + \addtocounter{#1}\m@ne\fi } % \end{macrocode} -% The above code may look a bit odd: the \cs{stepcounter} sets -% the counter to zero and then the \cs{setcounter} does the -% same. The reason is that \cs{stepcounter} resets other counters -% and when perpage is loaded this results in updating counters on -% the reset list to 1, which is precisely the problem here. So -% the second \cs{setcounter} undoes this if it happens. +% The above code may look a bit odd: the \cs{stepcounter} sets the +% counter to zero and then we alter it if it is not zero. The +% reason is that \cs{stepcounter} resets other counters and when +% perpage is loaded this results in updating counters on the reset +% list to 1 (or to a higher starting value if \cs{MakePerPage} is +% used with an optional argument, which is precisely the problem +% here. By subtracting 1 in that case we set it back to 1 lower +% than the starting value. % -% But to make this fully work we also need to update a suport +% But to make this fully work we also need to update a support % command in \pkg{perpage}: % \begin{macrocode} - \def\pp@cl@end@iii\stepcounter#1\setcounter#2#3{} + \def\pp@cl@end@iii\stepcounter#1\pp@fix@MakePerPage#2{} % \end{macrocode} % % \begin{macrocode} -- cgit v1.2.3