texlive[67937] Master/texmf-dist: zref-clever (15aug23)
commits+karl at tug.org
commits+karl at tug.org
Tue Aug 15 22:21:59 CEST 2023
Revision: 67937
http://tug.org/svn/texlive?view=revision&revision=67937
Author: karl
Date: 2023-08-15 22:21:58 +0200 (Tue, 15 Aug 2023)
Log Message:
-----------
zref-clever (15aug23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/zref-clever/CHANGELOG.md
trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-code.pdf
trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-doc.pdf
trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-doc.tex
trunk/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx
trunk/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty
Modified: trunk/Master/texmf-dist/doc/latex/zref-clever/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/zref-clever/CHANGELOG.md 2023-08-15 20:21:44 UTC (rev 67936)
+++ trunk/Master/texmf-dist/doc/latex/zref-clever/CHANGELOG.md 2023-08-15 20:21:58 UTC (rev 67937)
@@ -1,7 +1,15 @@
# Changelog
-## [Unreleased](https://github.com/gusbrs/zref-clever/compare/v0.4.1...HEAD)
+## [Unreleased](https://github.com/gusbrs/zref-clever/compare/v0.4.2...HEAD)
+## [v0.4.2](https://github.com/gusbrs/zref-clever/compare/v0.4.1...v0.4.2) (2023-08-14)
+
+### Changed
+- Thanks to better support for `zref` in `memoir`, the corresponding
+ compatibility module has been simplified and made more robust, without loss
+ of functionality.
+- Use `\label` instead of `\zlabel` in regression tests.
+
## [v0.4.1](https://github.com/gusbrs/zref-clever/compare/v0.4.0...v0.4.1) (2023-06-19)
### Changed
Modified: trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-code.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-doc.tex 2023-08-15 20:21:44 UTC (rev 67936)
+++ trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-doc.tex 2023-08-15 20:21:58 UTC (rev 67937)
@@ -67,7 +67,7 @@
\NewDocumentCommand\username{m}{`\texttt{#1}'}
\makeatletter
-\newcommand{\zcrequiredkernelversion}{\zc at required@kernel at version}
+\newcommand{\zcrequiredkernel}{\zrefclever at required@kernel}
\makeatother
\setlength{\marginparsep}{2\labelsep}
@@ -416,12 +416,11 @@
\pkg{zref-clever} requires \pkg{zref}, particularly its \pkg{zref-base},
\pkg{zref-user} and \pkg{zref-abspage} modules, and the \LaTeX{} kernel
-\zcrequiredkernelversion{}, or newer. It requires UTF-8 input encoding, which
-has been the kernel's default for some time. It also needs \pkg{ifdraft}.
-Some packages are leveraged by \pkg{zref-clever} if they are present, but are
-not loaded by default or required by it, namely: \pkg{hyperref},
-\pkg{zref-check}, and \pkg{zref}'s \pkg{zref-hyperref} and \pkg{zref-xr}
-modules.
+\zcrequiredkernel{}, or newer. It requires UTF-8 input encoding, which has
+been the kernel's default for some time. It also needs \pkg{ifdraft}. Some
+packages are leveraged by \pkg{zref-clever} if they are present, but are not
+loaded by default or required by it, namely: \pkg{hyperref}, \pkg{zref-check},
+and \pkg{zref}'s \pkg{zref-hyperref} and \pkg{zref-xr} modules.
\section{User interface}
@@ -2370,22 +2369,15 @@
command hook to \cs{appendix} for the purpose.
\DescribeOption{memoir} %
-The \cls{memoir} class implements several features with one or another
-implication for cross-referencing, usually bearing just the standard
-referencing system in mind, and related mainly to captions, subfloats, and
-notes. This compatibility module tries to adjust \pkg{zref-clever} to these
-features with support for the following: i) set counter types for counters
-\texttt{subfigure}, \texttt{subtable}, and \texttt{poemline} (used in the
-\env{verse} environment); ii) configure resetting behavior
-(\opt{counterresetby} option) for \texttt{subfigure} and \texttt{subtable}
-counters; iii) provide the \pkg{zref} property ``\texttt{subcaption}'' so that
-we can refer to, for example, \texttt{\cs{zcref}[ref=subcaption]\{subcap-1\}}
-to emulate the functionality of \cls{memoir}'s \cs{subcaptionref}; iv) provide
-that \cs{footnote}, \cs{verbfootnote}, \cs{sidefootnote}, and \cs{pagenote}
-get a proper \opt{currentcounter} set; and v) set counter types for counters
-\texttt{sidefootnote} and \texttt{pagenote}. The most sensitive changes are
-the use of \pkg{ltcmdhooks} command hooks on \cs{@memsubcaption},
-\cs{@makefntext}, and \cs{@makesidefntext}.
+This compatibility module provides support for some of \cls{memoir}'s
+cross-referencing features. Namely, it: i) sets counter types for counters
+\texttt{subfigure}, \texttt{subtable}, \texttt{poemline} (used in the
+\env{verse} environment), \texttt{sidefootnote}, and \texttt{pagenote}; ii)
+configures resetting behavior (\opt{counterresetby} option) for
+\texttt{subfigure} and \texttt{subtable} counters; iii) provides the
+\pkg{zref} property ``\texttt{subcaption}'' so that we can refer to, for
+example, \texttt{\cs{zcref}[ref=subcaption]\{subcap-1\}} to emulate the
+functionality of \cls{memoir}'s \cs{subcaptionref}.
\DescribeOption{amsmath} %
The module ensures proper \opt{currentcounter} values are in place for the
@@ -2598,6 +2590,7 @@
% 2022-04-09: https://github.com/latex3/hyperref/issues/229#issuecomment-1093870142
% 2023-01-02: https://tex.stackexchange.com/q/670399 (comments)
% 2023-06-01: https://github.com/latex3/latex2e/pull/956
+ % 2023-07-27: https://chat.stackexchange.com/transcript/message/64067726#64067726
Phelype Oleinik,
% 2021-08-20: https://tex.stackexchange.com/q/611370 (comments)
% 2021-09-09: https://tex.stackexchange.com/a/614704
@@ -2623,6 +2616,7 @@
% 2023-01-02: https://chat.stackexchange.com/transcript/message/62684358#62684358
% and following discussion.
% 2023-02-10: https://tex.stackexchange.com/a/674846
+ % 2023-07-27: https://chat.stackexchange.com/transcript/message/64067575#64067575
Frank Mittelbach,
% 2021-10-14: https://github.com/latex3/latex2e/issues/687
\username{samcarter},
@@ -2648,10 +2642,20 @@
Thomas F. Sturm,
% 2023-02-09: https://github.com/T-F-S/tcolorbox/issues/206
% 2023-05-12: https://github.com/T-F-S/tcolorbox/issues/230
- and Yukai Chou. % 'muzimuzhi'
+ Yukai Chou, % 'muzimuzhi'
% 2023-02-18: https://github.com/gusbrs/zref-clever/pull/14
% 2023-02-18: https://github.com/gusbrs/zref-clever/pull/15
% 2023-05-11: https://github.com/T-F-S/tcolorbox/issues/230
+ and Lars Madsen.
+ % 2023-07-24: https://chat.stackexchange.com/transcript/message/64039717#64039717
+ % and following discussion.
+ % 2023-07-26: https://chat.stackexchange.com/transcript/message/64057725#64057725
+ % 2023-07-31: https://chat.stackexchange.com/transcript/message/64105457#64105457
+ % and following discussion.
+ % 2023-08-08: Improved 'zref' and 'zref-clever' support for 'memoir' with
+ % v3.8. Email exchange "Subject: [FR] Improve support for zref
+ % in memoir", starting with
+ % rfc822msgid:CAM9ALR84v=nUTO14moPhbuDjQx9EJ1pcWAku5FdwOo9hbadwYA at mail.gmail.com.
The package's language files have been provided or improved thanks to:
Denis Bitouzé (French),
Modified: trunk/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx 2023-08-15 20:21:44 UTC (rev 67936)
+++ trunk/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx 2023-08-15 20:21:58 UTC (rev 67937)
@@ -151,18 +151,16 @@
% we require that too. Hence we make the cut at this latter kernel release.
%
% \begin{macrocode}
-\newcommand{\zc at required@kernel at version}{2023-06-01}
-\NeedsTeXFormat{LaTeX2e}
+\def\zrefclever at required@kernel{2023-06-01}
+\NeedsTeXFormat{LaTeX2e}[\zrefclever at required@kernel]
\providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
-\IfFormatAtLeastTF{\zc at required@kernel at version}
+\IfFormatAtLeastTF{\zrefclever at required@kernel}
{}
{%
\PackageError{zref-clever}{LaTeX kernel too old}
{%
- 'zref-clever' requires a LaTeX kernel \zc at required@kernel at version\space or newer.%
- \MessageBreak Loading will abort!%
+ 'zref-clever' requires a LaTeX kernel \zrefclever at required@kernel\space or newer.%
}%
- \endinput
}%
% \end{macrocode}
%
@@ -169,7 +167,7 @@
%
% Identify the package.
% \begin{macrocode}
-\ProvidesExplPackage {zref-clever} {2023-06-19} {0.4.1}
+\ProvidesExplPackage {zref-clever} {2023-08-14} {0.4.2}
{Clever LaTeX cross-references based on zref}
% \end{macrocode}
%
@@ -3768,6 +3766,10 @@
% This allows one to manually specify the reference type. It is the
% equivalent of \pkg{cleveref}'s optional argument to \cs{label}.
%
+% NOTE \pkg{tcolorbox} uses the \opt{reftype} option to support its \opt{label
+% type} option when \opt{label is zlabel}. Hence \emph{don't} make any
+% breaking changes here without previous communication.
+%
% \begin{macrocode}
\tl_new:N \l_@@_reftype_override_tl
\keys_define:nn { zref-clever/label }
@@ -7405,7 +7407,7 @@
% This avoids using the internal \cs[replace=false]{hyper@@link}, using only
% public \pkg{hyperref} commands (see
% \url{https://github.com/latex3/hyperref/issues/229#issuecomment-1093870142},
-% thanks \contributor{Ulrike Fisher}).
+% thanks \contributor{Ulrike Fischer}).
% \begin{syntax}
% \cs{@@_hyperlink:nnn} \Arg{url/file} \Arg{anchor} \Arg{text}
% \end{syntax}
@@ -7816,38 +7818,24 @@
% \subsection{\opt{memoir}}
%
% The \cls{memoir} document class has quite a number of cross-referencing
-% related features, mostly dealing with captions, subfloats, and notes. Some
-% of them are implemented in ways which make difficult the use of \pkg{zref},
-% particularly \cs{zlabel}, short of redefining the whole stuff ourselves.
-% Fortunately, however, the kernel's new \texttt{label} hook, and the
-% \opt{labelhook} option, make things somewhat easier.
+% related features, mostly dealing with captions, subfloats, and notes. It
+% used to be the case that a good number of them where implemented in ways
+% which make difficult the use of \pkg{zref}, particularly \cs{zlabel}, short
+% of redefining the whole stuff ourselves. Problematic cases included: i)
+% side captions; ii) bilingual captions; iii) subcaption references; and iv)
+% footnotes, verbfootnotes, sidefootnotes, and pagenotes.
%
-% \begin{enumerate}
-% \item The \cs{subcaptionref} command, which makes a reference to the
-% subcaption without the number of the main caption (e.g. ``(b)'', instead
-% of ``2.3(b)''), for labels set inside the \meta{subtitle} argument of the
-% subcaptioning commands, namely: \cs{subcaption}, \cs{contsubcaption},
-% \cs{subbottom}, \cs{contsubbottom}, \cs{subtop}. This functionality is
-% implemented by \cls{memoir} by setting a \emph{second label} with prefix
-% \texttt{sub@\meta{label}}, and storing there just that part of interest.
-% With \pkg{zref} this part is easier, since we can just add an extra
-% property and retrieve it later on. The thing is that it is hard to find a
-% place to hook into to add the property to the \texttt{main} list, since
-% \cls{memoir} does not really consider the possibility of some other
-% command setting labels. \cs{@memsubcaption} is the best place to hook I
-% could find. It is used by subcaptioning commands, and only those. And
-% there is no hope for an environment hook in this case anyway.
-% \item \cls{memoir}'s \cs{footnote}, \cs{verbfootnote}, \cs{sidefootnote} and
-% \cs{pagenote}, just as the regular \cs{footnote} until recently in the
-% kernel, do not set \cs{@currentcounter} alongside \cs{@currentlabel},
-% proper referencing to them requires setting the type for it.
-% \item Note that \cls{memoir}'s appendix features ``emulates'' the
-% \pkg{appendix} package, hence the corresponding compatibility module is
-% loaded for \cls{memoir} even if that package is not itself loaded. The
-% same is true for the \cs{appendix} command module, since it is also
-% defined.
-% \end{enumerate}
+% However, since then, the situation has much improved, given two main
+% upstream changes: i) the kernel's new \texttt{label} hook with argument,
+% introduced in the release of 2023-06-01 (thanks to \contributor{Ulrike
+% Fischer} and \contributor{Phelype Oleinik}) and ii) better support for
+% \pkg{zref} and \pkg{zref-clever} from the \cls{memoir} class itself, with
+% release of \texttt{2023/08/08 v3.8} (thanks to \contributor{Lars Madsen}).
%
+% Also, note that \cls{memoir}'s appendix features ``emulates'' the
+% \pkg{appendix} package, hence the corresponding compatibility module is
+% loaded for \cls{memoir} even if that package is not itself loaded. The same
+% is true for the \cs{appendix} command module, since it is also defined.
%
% \begin{macrocode}
\@@_compat_module:nn { memoir }
@@ -7876,27 +7864,15 @@
} ,
}
% \end{macrocode}
-% Support for \texttt{subcaption} reference.
+% Support for \texttt{subcaption} references.
% \begin{macrocode}
\zref at newprop { subcaption }
{ \cs_if_exist_use:c { @@@@thesub \@captype } }
- \AddToHook{ cmd / @memsubcaption / before }
+ \AddToHook{ memoir/subcaption/aftercounter }
{ \zref at localaddprop \ZREF at mainlist { subcaption } }
% \end{macrocode}
-% Support for \cs{footnote}, \cs{verbfootnote}, \cs{sidefootnote}, and
-% \cs{pagenote}.
+% Support for \cs{sidefootnote} and \cs{pagenote}.
% \begin{macrocode}
- \tl_new:N \l_@@_memoir_footnote_type_tl
- \tl_set:Nn \l_@@_memoir_footnote_type_tl { footnote }
- \AddToHook { env / minipage / begin }
- { \tl_set:Nn \l_@@_memoir_footnote_type_tl { mpfootnote } }
- \AddToHook { cmd / @makefntext / before }
- {
- \@@_zcsetup:x
- { currentcounter = \l_@@_memoir_footnote_type_tl }
- }
- \AddToHook { cmd / @makesidefntext / before }
- { \@@_zcsetup:n { currentcounter = sidefootnote } }
\@@_zcsetup:n
{
countertype =
@@ -7905,8 +7881,6 @@
pagenote = endnote ,
} ,
}
- \AddToHook { file / \jobname.ent / before }
- { \@@_zcsetup:x { currentcounter = pagenote } }
\msg_info:nnn { zref-clever } { compat-class } { memoir }
}
}
Modified: trunk/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty 2023-08-15 20:21:44 UTC (rev 67936)
+++ trunk/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty 2023-08-15 20:21:58 UTC (rev 67937)
@@ -42,20 +42,18 @@
%%
%% -----------------------------------------------------------------------
%%
-\newcommand{\zc at required@kernel at version}{2023-06-01}
-\NeedsTeXFormat{LaTeX2e}
+\def\zrefclever at required@kernel{2023-06-01}
+\NeedsTeXFormat{LaTeX2e}[\zrefclever at required@kernel]
\providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
-\IfFormatAtLeastTF{\zc at required@kernel at version}
+\IfFormatAtLeastTF{\zrefclever at required@kernel}
{}
{%
\PackageError{zref-clever}{LaTeX kernel too old}
{%
- 'zref-clever' requires a LaTeX kernel \zc at required@kernel at version\space or newer.%
- \MessageBreak Loading will abort!%
+ 'zref-clever' requires a LaTeX kernel \zrefclever at required@kernel\space or newer.%
}%
- \endinput
}%
-\ProvidesExplPackage {zref-clever} {2023-06-19} {0.4.1}
+\ProvidesExplPackage {zref-clever} {2023-08-14} {0.4.2}
{Clever LaTeX cross-references based on zref}
\RequirePackage { zref-base }
\RequirePackage { zref-user }
@@ -5465,19 +5463,8 @@
}
\zref at newprop { subcaption }
{ \cs_if_exist_use:c { @@thesub \@captype } }
- \AddToHook{ cmd / @memsubcaption / before }
+ \AddToHook{ memoir/subcaption/aftercounter }
{ \zref at localaddprop \ZREF at mainlist { subcaption } }
- \tl_new:N \l__zrefclever_memoir_footnote_type_tl
- \tl_set:Nn \l__zrefclever_memoir_footnote_type_tl { footnote }
- \AddToHook { env / minipage / begin }
- { \tl_set:Nn \l__zrefclever_memoir_footnote_type_tl { mpfootnote } }
- \AddToHook { cmd / @makefntext / before }
- {
- \__zrefclever_zcsetup:x
- { currentcounter = \l__zrefclever_memoir_footnote_type_tl }
- }
- \AddToHook { cmd / @makesidefntext / before }
- { \__zrefclever_zcsetup:n { currentcounter = sidefootnote } }
\__zrefclever_zcsetup:n
{
countertype =
@@ -5486,8 +5473,6 @@
pagenote = endnote ,
} ,
}
- \AddToHook { file / \jobname.ent / before }
- { \__zrefclever_zcsetup:x { currentcounter = pagenote } }
\msg_info:nnn { zref-clever } { compat-class } { memoir }
}
}
More information about the tex-live-commits
mailing list.