texlive[72798] Master/texmf-dist: zref-clever (8nov24)
commits+karl at tug.org
commits+karl at tug.org
Fri Nov 8 23:05:46 CET 2024
Revision: 72798
https://tug.org/svn/texlive?view=revision&revision=72798
Author: karl
Date: 2024-11-08 23:05:45 +0100 (Fri, 08 Nov 2024)
Log Message:
-----------
zref-clever (8nov24)
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 2024-11-08 22:05:35 UTC (rev 72797)
+++ trunk/Master/texmf-dist/doc/latex/zref-clever/CHANGELOG.md 2024-11-08 22:05:45 UTC (rev 72798)
@@ -1,7 +1,14 @@
# Changelog
-## [Unreleased](https://github.com/gusbrs/zref-clever/compare/v0.4.7...HEAD)
+## [Unreleased](https://github.com/gusbrs/zref-clever/compare/v0.4.8...HEAD)
+## [v0.4.8](https://github.com/gusbrs/zref-clever/compare/v0.4.7...v0.4.8) (2024-11-07)
+
+### Changed
+- Documentation improvements.
+- Preemptively avoid empty module when setting l3keys `.inherit:n`
+ (https://github.com/latex3/latex3/issues/1254).
+
## [v0.4.7](https://github.com/gusbrs/zref-clever/compare/v0.4.6...v0.4.7) (2024-09-30)
### 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 2024-11-08 22:05:35 UTC (rev 72797)
+++ trunk/Master/texmf-dist/doc/latex/zref-clever/zref-clever-doc.tex 2024-11-08 22:05:45 UTC (rev 72798)
@@ -156,7 +156,7 @@
\zcsetup{countertype={lstlisting=zchowto}}%
\lstset{#1}%
\stepcounter{zchowto}%
- \setcounter{lstlisting}{\value{zchowto}}%
+ \setcounter{lstlisting}{\value{zchowto}-1}%
}{}
\newcounter{zcworkaround}
\lstnewenvironment{zcworkaround}[1][]{%
@@ -251,17 +251,21 @@
However, the standard cross-referencing system traditionally stored two, and
only two, properties with the label: the printed representation of the counter
-last incremented with \cs{refstepcounter} and the page.\footnote{Nowadays, it
- stores 5, so that \pkg{hyperref} and \pkg{nameref} no longer need to
- redefine \cs{label}.} Of course, out of the mentioned desire to automate
-more, the need arose to store more information about the label to support
-this: the title or caption of the referenced object; its counter or, even
-better, its ``type'', that is, whether it is a section, chapter, figure, etc.;
-its hyperlink anchor, and so on. Thus those two property ``fields'' of the
-standard label became quite a disputed real state. And the packages in this
-area of functionality, or which somehow depended on extending the
-cross-referencing mechanism, were bound to step on each other's toes as a
-result.
+last incremented with \cs{refstepcounter} and the page. Of course, out of the
+mentioned desire to automate more, the need arose to store more information
+about the label to support this: the title or caption of the referenced
+object; its counter or, even better, its ``type'', that is, whether it is a
+section, chapter, figure, etc.; its hyperlink anchor, and so on. Thus those
+two property ``fields'' of the standard label became quite a disputed real
+state. And the packages in this area of functionality, or which somehow
+depended on extending the cross-referencing mechanism, were bound to step on
+each other's toes as a result. Nowadays (2024), many of these issues have
+changed for the better. Notably, now the kernel's \cs{label} already stores
+five arguments, regardless of the presence of \pkg{hyperref}, and also
+provides a hook with the label as argument so that packages can extend its
+functionality without the need to redefine it, as \pkg{nameref} now already
+does (and so does \pkg{zref-clever}).\footnote{We are currently observing some
+ of the pains of adjusting the ecosystem to these improvements though\dots{}}
Out of this conundrum, Heiko Oberdiek eventually developed \pkg{zref}, which
implements an extensible referencing system, making the labels store a
@@ -299,14 +303,12 @@
\pkg{varioref}, a significant part of the most prominent automation features
available to the standard referencing system is thus brought to \pkg{zref},
working under a single consistent underlying infrastructure and user
-interface. Alas, there are some limitations (see \zcref{sec:limitations}),
-and it may be your cup of tea or not. Still, all in all, hopefully
-\pkg{zref-clever} can make \pkg{zref} more accessible to the average user, and
-more interesting to users in general.
+interface. All in all, hopefully \pkg{zref-clever} can make \pkg{zref} more
+accessible to the average user, and more interesting to users in general.
\section{Warning}
-\zlabel{sec:warning}
+\label{sec:warning}
This package is in its early days, and should be considered experimental. By
this I don't mean I expect it to be ``edgy'', indeed quite a lot of effort has
@@ -323,21 +325,16 @@
\section{\pkg{zref-clever} for the impatient}
-\pkg{zref-clever} is based on \pkg{zref}'s referencing system which, though
-independent of the standard one, is very similar to it in its user interface.
-Indeed, to use \pkg{zref}, instead of setting a \cs{label} and making a
-\cs{ref}, one would set a \cs{zlabel} and make \cs{zref}s to it, in pretty
-much the same way as for the standard system. \pkg{zref-clever} introduces
-the more featureful \cs{zcref} for making references, but relies on
-\pkg{zref}'s \cs{zlabel} for label setting. \pkg{zref-clever} provides that a
-\cs{label} also sets a \cs{zlabel} with the same name using the kernel's
-\texttt{label} hook (see the \opt{labelhook} option in \zcref{sec:options}),
-so that you can use it too with standard \cs{label}s (see the
-\zcref{sec:label-or-zlabel} for discussion).
+Making cross-references with \pkg{zref-clever} is very similar to the standard
+referencing system in its user interface: one sets a label, with \cs{label},
+which can then be referenced, in our case with \cs{zcref}, which is the main
+and basic entrance for making references with \pkg{zref-clever}. \cs{zcref}
+receives a list of labels as argument and its behavior can be locally changed
+through the optional argument.
-A basic document using \pkg{zref-clever} is shown in \zcref{how:basic} which,
-despite the small necessary adjustments, should feel very familiar to any
-\LaTeX{} user acquainted with the standard referencing system:
+A basic document using \pkg{zref-clever} is shown in \zcref{how:basic} which
+should feel very familiar to any \LaTeX{} user acquainted with the standard
+referencing system:
\begin{zchowto}[caption={Basic usage},label={how:basic}]
\documentclass{article}
@@ -345,11 +342,11 @@
\usepackage{hyperref}
\begin{document}
\section{Section 1}
-\zlabel{sec:section-1}
+\label{sec:section-1}
\begin{figure}
A figure.
\caption{Figure 1}
- \zlabel{fig:figure-1}
+ \label{fig:figure-1}
\end{figure}
A reference to \zcref{sec:section-1}. \zcref[S]{fig:figure-1} shows some
interesting information.
@@ -394,7 +391,7 @@
\section{Loading the package}
-\zlabel{sec:loading-package}
+\label{sec:loading-package}
\pkg{zref-clever} can be loaded with the usual:
@@ -418,7 +415,7 @@
\section{User interface}
-\zlabel{sec:user-interface}
+\label{sec:user-interface}
\begin{function}{\zcref}
\begin{syntax}
@@ -476,61 +473,9 @@
default. So you also have its user commands available out of the box,
including \cs{zref} and \cs{zpageref}, but notably:
-\begin{function}{\zlabel}
- \begin{syntax}
- \cs{zlabel}\marg{label}
- \end{syntax}
-\end{function}
-Sets \meta{label} for referencing with \cs{zref} and, thus, also \cs{zcref}.
-\cs{zlabel} is provided by \pkg{zref-user} and is the counterpart of
-\cs{label} for \pkg{zref}'s referencing system.
-
-\section{\cs{label} or \cs{zlabel}?}
-\zlabel{sec:label-or-zlabel}
-
-Technically, \pkg{zref}'s referencing system, and thus also \pkg{zref-clever},
-require a label set with \cs{zlabel} to make a reference. However, the
-\opt{labelhook} option (see \zcref{sec:options}) leverages the kernel's
-\texttt{label} hook to also set a \cs{zlabel} when a standard \cs{label} is
-called, so that we can simply use \cs{label}s in our document and refer to
-them with either referencing system. Indeed, in some places the use of
-\cs{label} this way may be required (see
-\zcref{sec:limitations,sec:comp-modules}). That given, which is to be
-preferred: use \cs{label} all around or normally use \cs{zlabel} and,
-occasionally resort to \cs{label} where required? I guess it depends, but we
-can reason the pros and cons of both alternatives.
-
-Simply using \cs{label} across your document clearly speaks for convenience.
-You don't have to worry with the exceptional case where a \cs{zlabel} may not
-work or setting it is not possible. You can use either referencing system for
-your labels as desired. Your favorite editor may have some facilities to ease
-the insertion of labels, but does not support \cs{zlabel}. And so on. The
-only disadvantage I can see with this approach is that two labels end up in
-the \file{.aux} file which, arguably, may be seen as a redundancy, or waste.
-
-It is probably fair to consider this redundancy, in most use cases, as a
-negligible cost. But you may disagree, or the size of your document or your
-requirements may say otherwise, in which case you may prefer the second
-approach and use \cs{zlabel} normally, with some occasional \cs{label} where
-needed. Known relevant cases where \cs{label} is required are documented in
-the manual (see \zcref{sec:how-tos,sec:limitations,sec:comp-modules}), but
-some trial and error can easily cover the gap for the remaining cases. They
-are also rare cases. So finding out where \cs{label} is required should not
-be much of a trouble either.
-
-I think the first approach does deserve the status of ``recommended'' for
-normal use cases and documents. Despite that, note that the examples of this
-manual typically use the second approach. There's a historic reason for this,
-since most of them were created before the kernel's \texttt{label} hook was
-available, so that it was really the only approach. However, I'll keep the
-examples this way, notwithstanding this recommendation, because it is also
-important to document the limitations of directly using \cs{zlabel}, for those
-who may want to use the second approach.
-
-
\section{Options}
-\zlabel{sec:options}
+\label{sec:options}
\pkg{zref-clever} is highly configurable, offering a lot of flexibility in
typeset results of the references, but it also tries to keep these ``handles''
@@ -560,9 +505,9 @@
The \opt{ref} option controls the label property to which \cs{zcref} refers
to. It can receive \pkg{zref} properties, as long as they are declared, but
notably \texttt{default}, \texttt{page}, \texttt{thecounter} and, if
-\pkg{zref-titleref} is loaded, \texttt{title}. The package's default is,
-well, \texttt{default}, which is our standard reference. \texttt{thecounter}
-is a property set by \pkg{zref-clever} and is similar to \pkg{zref}'s
+\pkg{zref-titleref} is loaded, \texttt{title}. The initial value is
+\texttt{default}, which is our standard reference. \texttt{thecounter} is a
+property set by \pkg{zref-clever} and is similar to \pkg{zref}'s
\texttt{default} property, except that it is not affected by the kernel's
\cs{labelformat}.\footnote{Technical note: the \texttt{default} property
stores \cs{@currentlabel}, while the \texttt{thecounter} property stores
@@ -606,9 +551,9 @@
\DescribeOption{sort} %
\DescribeOption{nosort} %
The \opt{sort} option controls whether the list of \meta{labels} received as
-argument by \cs{zcref} should be sorted or not. It is a boolean option, and
-defaults to \texttt{true}. The \opt{nosort} option is a convenience alias for
-\texttt{sort=false}.
+argument by \cs{zcref} should be sorted or not. It is a boolean option, with
+initial value \texttt{true}. The \opt{nosort} option is a convenience alias
+for \texttt{sort=false}.
\DescribeOption{typesort} %
\DescribeOption{notypesort} %
@@ -644,8 +589,8 @@
\cs{zcref} can automatically compress a set of references of the same type
into a range, when they occur in immediate sequence. The \opt{comp} controls
whether this compression should take place or not. It is a boolean option,
-and defaults to \texttt{true}. The \opt{nocomp} option is a convenience alias
-for \texttt{comp=false}. Of course, for better compression results the
+with initial value \texttt{true}. The \opt{nocomp} option is a convenience
+alias for \texttt{comp=false}. Of course, for better compression results the
\opt{sort} is recommended, but the two options are technically independent.
\DescribeOption{endrange} %
@@ -656,32 +601,31 @@
comparing it with the beginning reference, to achieve a given end
result.\footnote{For the \TeX{}nically inclined: those values that perform
some processing -- namely \texttt{stripprefix}, \texttt{pagecomp}, and
- \texttt{pagecomp2} -- fully expand the references (\texttt{x}-type
- expansion) before comparing them, since it makes sense to perform this task
- as close as possible to the printed representation of the references. I
- don't expect this to be a problem in normal use cases, but it does represent
- a limitation on what the references can contain. In case some control over
- this is needed, check the \texttt{zref-clever/endrange-setup} hook in the
- code documentation.} Or, it can specify a label property to be used
-directly, without any processing. The available predefined values are:
-\texttt{ref}, \texttt{stripprefix}, \texttt{pagecomp}, and \texttt{pagecomp2}.
-\texttt{ref} corresponds to the default behavior, and instructs \cs{zcref} to
-use whatever property was set at the \opt{ref} option for the end of range
-reference. \texttt{stripprefix} strips the common part at the start of each
-reference from the end one. \texttt{pagecomp} is the equivalent of
-\texttt{stripprefix} for page numbers, it does the same thing, but only if the
-references are comprised exclusively of Arabic numerals. \texttt{pagecomp2}
-is a variant of \texttt{pagecomp} that leaves at least two digits at the end
-reference (except for a leading zero). If values other than the predefined
-ones are given to \opt{endrange} they are considered as label properties, as
-long as they are declared. This property is used to typeset the end of range
-reference if the label contains it, and if both references would be
-``compressible'' according to the \opt{comp} option, otherwise the property
-specified by the \opt{ref} option is used. This is useful for things like
-sub-elements for which we can build a proper abbreviated sub-reference and
-populate the label with it (some compatibility modules already provide a
-number of such properties, but other ones can be built with \pkg{zref}, as
-needed).
+ \texttt{pagecomp2} -- fully expand the references before comparing them,
+ since it makes sense to perform this task as close as possible to the
+ printed representation of the references. I don't expect this to be a
+ problem in normal use cases, but it does represent a limitation on what the
+ references can contain. In case some control over this is needed, check the
+ \texttt{zref-clever/endrange-setup} hook in the code documentation.} Or, it
+can specify a label property to be used directly, without any processing. The
+available predefined values are: \texttt{ref}, \texttt{stripprefix},
+\texttt{pagecomp}, and \texttt{pagecomp2}. \texttt{ref} corresponds to the
+default behavior, and instructs \cs{zcref} to use whatever property was set at
+the \opt{ref} option for the end of range reference. \texttt{stripprefix}
+strips the common part at the start of each reference from the end one.
+\texttt{pagecomp} is the equivalent of \texttt{stripprefix} for page numbers,
+it does the same thing, but only if the references are comprised exclusively
+of Arabic numerals. \texttt{pagecomp2} is a variant of \texttt{pagecomp} that
+leaves at least two digits at the end reference (except for a leading zero).
+If values other than the predefined ones are given to \opt{endrange} they are
+considered as label properties, as long as they are declared. This property
+is used to typeset the end of range reference if the label contains it, and if
+both references would be ``compressible'' according to the \opt{comp} option,
+otherwise the property specified by the \opt{ref} option is used. This is
+useful for things like sub-elements for which we can build a proper
+abbreviated sub-reference and populate the label with it (some compatibility
+modules already provide a number of such properties, but other ones can be
+built with \pkg{zref}, as needed).
\DescribeOption{range} %
\DescribeOption{rangetopair} %
@@ -694,41 +638,35 @@
disregarded) and, for each reference type group in \meta{labels}, \cs{zcref}
builds a range from the first to the last reference in it, even if references
in between do not occur in immediate sequence. It is a boolean option, and
-the package's default is \texttt{range=false}. The option given without a
-value is equivalent to \texttt{range=true} (in the \pkg{l3keys}' jargon, the
-\emph{option}'s default is \texttt{true}). \cs{zcref} is smart enough to
-recognize when the first and last references of a type do happen to be
-contiguous, in which case it typesets a ``pair'', instead of a ``range''. But
-this behavior can be disabled by setting the \opt{rangetopair} option to
-\texttt{false}.
+the initial value is \texttt{false}. \cs{zcref} is smart enough to recognize
+when the first and last references of a type do happen to be contiguous, in
+which case it typesets a ``pair'', instead of a ``range''. But this behavior
+can be disabled by setting the \opt{rangetopair} option to \texttt{false}.
\DescribeOption{cap} %
\DescribeOption{nocap} %
\DescribeOption{capfirst} %
The \opt{cap} option controls whether the reference type names should be
-capitalized or not. It can receive values \texttt{true} or \texttt{false},
-and it can also be set for specific reference types or languages (see
-\zcref{sec:reference-format}). The option given without a value is equivalent
-to \texttt{cap=true}. The \opt{nocap} option is a convenience alias for
-\texttt{cap=false}. The \opt{capfirst} option ensures that the reference type
-name of the \emph{first} type block is capitalized, even when \opt{cap} is set
-to \texttt{false}.
+capitalized or not. It is a boolean option, and it can also be set for
+specific reference types or languages (see \zcref{sec:reference-format}). The
+\opt{nocap} option is a convenience alias for \texttt{cap=false}. The
+\opt{capfirst} option ensures that the reference type name of the \emph{first}
+type block is capitalized, even when \opt{cap} is set to \texttt{false}.
\DescribeOption{abbrev} %
\DescribeOption{noabbrev} %
\DescribeOption{noabbrevfirst} %
The \opt{abbrev} option controls whether to use abbreviated reference type
-names when they are available. It can receive values \texttt{true} or
-\texttt{false}, and it can also be set for specific reference types or
-languages (see \zcref{sec:reference-format}). The option given without a
-value is equivalent to \texttt{abbrev=true}. The \opt{noabbrev} option is a
-convenience alias for \texttt{abbrev=false}. The \opt{noabbrevfirst} ensures
-that the reference type name of the \emph{first} type block is never
-abbreviated, even when \opt{abbrev} is set to \texttt{true}.
+names when they are available. It is a boolean option, and it can also be set
+for specific reference types or languages (see \zcref{sec:reference-format}).
+The \opt{noabbrev} option is a convenience alias for \texttt{abbrev=false}.
+The \opt{noabbrevfirst} ensures that the reference type name of the
+\emph{first} type block is never abbreviated, even when \opt{abbrev} is set to
+\texttt{true}.
\DescribeOption{S} %
\opt{S} for ``Sentence''. The \opt{S} option is a convenience alias for
-\texttt{capfirst=true, noabbrevfirst=true}, and is intended to be used in
+\texttt{noabbrevfirst=true, capfirst=true}, and is intended to be used in
references made at the beginning of a sentence. It is highly recommended that
you make a habit of using the \opt{S} option for beginning of sentence
references. Even if you do happen to be currently using \texttt{cap=true,
@@ -739,7 +677,7 @@
\DescribeOption{hyperref} %
The \opt{hyperref} option controls the use of \pkg{hyperref} by
\pkg{zref-clever} and takes values \opt{auto}, \opt{true}, \opt{false}. The
-default value, \opt{auto}, makes \pkg{zref-clever} use \pkg{hyperref} if it is
+initial value, \opt{auto}, makes \pkg{zref-clever} use \pkg{hyperref} if it is
loaded, meaning that references made with \cs{zcref} get hyperlinked to the
anchors of their respective \meta{labels}. \opt{true} does the same thing,
but warns if \pkg{hyperref} is not loaded (\pkg{hyperref} is never loaded for
@@ -772,7 +710,7 @@
``section'' names will be included in their respective links, while that of
``figure'' will not. If the option is set to \texttt{single}, only the name
for ``chapter'' in the first reference will be included in the link, while in
-the second reference none of them will. The package's default is
+the second reference none of them will. The initial value is
\texttt{nameinlink=tsingle}, and the option given without a value is
equivalent to \texttt{nameinlink=true}.
@@ -779,7 +717,7 @@
\DescribeOption{lang} %
The \opt{lang} option controls the language used by \cs{zcref} when looking
for language-specific reference format options (see
-\zcref{sec:reference-format}). The default value, \texttt{current}, uses the
+\zcref{sec:reference-format}). The initial value, \texttt{current}, uses the
current language, as defined by \pkg{babel} or \pkg{polyglossia} (or
\texttt{english} if none of them is loaded). Value \texttt{main} uses the
main document language, as defined by \pkg{babel} or \pkg{polyglossia} (or
@@ -814,7 +752,7 @@
keeps quiet when option \texttt{draft} is given to \cs{documentclass}, while
with \texttt{iffinal}, nudging is only enabled when option \texttt{final} is
(explicitly) passed to \cs{documentclass}. The option given without a value
-is equivalent to \texttt{nudge=true} and the package's default is
+is equivalent to \texttt{nudge=true} and the initial value is
\texttt{nudge=false}. \opt{nonudge} is a convenience alias for
\texttt{nudge=false}, and can be used to silence individual references. The
\opt{nudgeif} option controls the events which may trigger a nudge. It takes
@@ -873,7 +811,7 @@
bar\}} sets the \texttt{foo} counter to use the reference type \texttt{bar}.
There's only need to specify the \opt{countertype} for counters whose name
differs from that of their type, since \pkg{zref-clever} presumes the type has
-the same name as the counter, unless otherwise specified. Also, the default
+the same name as the counter, unless otherwise specified. Also, the initial
value of the option already sets appropriate types for basic \LaTeX{}
counters, including those from the standard classes. Setting a counter type
to an empty value removes any (explicit) type association for that counter, in
@@ -911,9 +849,9 @@
\pkg{zref-clever} can be thoroughly confused. The setting must correspond to
the actual resetting behavior of the involved counters. \opt{counterresetby}
has precedence over the search done in the \opt{counterresetters} list. The
-default value of \opt{counterresetters} includes the counters for sectioning
+initial value of \opt{counterresetters} includes the counters for sectioning
commands of the standard classes which, in most cases, should be the relevant
-ones for cross-referencing purposes. The default value of
+ones for cross-referencing purposes. The initial value of
\opt{counterresetby} includes the \texttt{enumerate} environment counters.
So, hopefully, you don't need to ever bother with either of these options.
But, if you do, they are here. Use them with caution though. Since these
@@ -921,19 +859,19 @@
\DescribeOption{\raisebox{.4em}{\dbend}\ currentcounter} %
\LaTeX{}'s \cs{refstepcounter} sets two variables which potentially affect the
-\cs{zlabel} set after it: \cs{@currentlabel} and \cs{@currentcounter}.
-Actually, traditionally, only the current label was thus stored, the current
-counter was added to \cs{refstepcounter} somewhat recently (with the
-2020-10-01 kernel release). But, since \pkg{zref-clever} relies heavily on
-the information of what the current counter is, it must set \pkg{zref} to
-store that information with the label, as it does. As long as the document
-element we are trying to refer to uses the standard machinery of
-\cs{refstepcounter} we are on solid ground and can retrieve the correct
-information. However, it is not always ensured that \cs{@currentcounter} is
-kept up to date. For example, packages which handle labels specially, for one
-reason or another, may or may not set \cs{@currentcounter} as required.
-Considering the addition of \cs{@currentcounter} to \cs{refstepcounter} itself
-is not that old, it is likely that in a good number of places a reliable
+\cs{label} set after it: \cs{@currentlabel} and \cs{@currentcounter}. But,
+since \pkg{zref-clever} relies heavily on the information of what the current
+counter is, it must set \pkg{zref} to store that information with the label,
+as it does. As long as the document element we are trying to refer to uses
+the standard machinery of \cs{refstepcounter} we are on solid ground and can
+retrieve the correct information. However, it is not always ensured that
+\cs{@currentcounter} is kept up to date. For example, packages which handle
+labels specially, for one reason or another, may or may not set
+\cs{@currentcounter} as required. Considering the addition of
+\cs{@currentcounter} to \cs{refstepcounter} itself is not that
+old,\footnote{Traditionally, only the current label was thus stored, the
+ current counter was added to \cs{refstepcounter} somewhat recently (with the
+ 2020-10-01 kernel release).} it is likely that in some places a reliable
\cs{@currentcounter} is not really in place. Therefore, it may happen we need
to tell \pkg{zref-clever} what the current counter is in certain
circumstances, and that's what \opt{currentcounter} does. The same as with
@@ -945,22 +883,23 @@
\opt{currentcounter} option, take care that the setting is duly grouped
because, if set, it has precedence over \cs{@currentcounter} and, contrary to
the later, the former is not reset the next time \cs{refstepcounter} runs.
-Its default value is, quite naturally, \cs{@currentcounter}. The default
-value can be reset by calling the option with no value. Since this option
-only affects how labels are set, it is not available in \cs{zcref}.
+Its initial value is, quite naturally, \cs{@currentcounter}, which can be
+reset by calling the option with no value. Since this option only affects how
+labels are set, it is not available in \cs{zcref}.
\DescribeOption{\raisebox{.4em}{\dbend}\ labelhook} %
\opt{labelhook} is a boolean option which controls whether \pkg{zref-clever}
uses the kernel's \texttt{label} hook to, whenever a standard \cs{label} is
-called, also set a \cs{zlabel} with the same name. The package's default
-value is \texttt{true} so that one can use \cs{label}s along the document and
-refer to them (also) with \pkg{zref} and \pkg{zref-clever} reference commands.
-This value is not only the default, but also a recommended value. Disabling
-this option means you are on your own to handle cases where \cs{zlabel} does
-not work, which are not many, but can be tricky to deal with where they occur.
-Since this option only affects how labels are set, it is not available in
-\cs{zcref}. See \zcref{sec:label-or-zlabel} for some discussion of different
-labeling approaches this options allows for.
+called, also set a \cs{zlabel} with the same name (which is what
+\pkg{zref-clever} actually uses to make its references). The package's
+initial value is \texttt{true} so that one can use \cs{label}s along the
+document and refer to them (also) with \pkg{zref} and \pkg{zref-clever}
+reference commands. This value is not only the default, but also a
+recommended value. Disabling this option means you are on your own to handle
+cases where \cs{zlabel} does not work, which are not many, but can be tricky
+to deal with where they occur. Since this option only affects how labels are
+set, it is not available in \cs{zcref}. See \zcref{sec:label-or-zlabel} for
+some discussion of different labeling approaches this options allows for.
\DescribeOption{nocompat} %
Some packages, document classes, or LaTeX features may require specific
@@ -980,7 +919,7 @@
\section{Reference types}
-\zlabel{sec:reference-types}
+\label{sec:reference-types}
A ``reference type'' is the basic \pkg{zref-clever} setup unit for specifying
how a cross-reference group of a certain kind is to be typeset. Though,
@@ -1001,7 +940,7 @@
\emph{type} for it, but this must be handled by \pkg{zref-clever} as an error
(at least, if we try to refer to it), usually a ``missing name'' error.
-\pkg{zref-clever} provides default settings for the following reference types:
+\pkg{zref-clever} provides initial settings for the following reference types:
\texttt{part}, \texttt{chapter}, \texttt{section}, \texttt{paragraph},
\texttt{appendix}, \texttt{subappendix}, \texttt{page}, \texttt{line},
\texttt{figure}, \texttt{table}, \texttt{item}, \texttt{footnote},
@@ -1023,12 +962,12 @@
\opt{countertype} option. As seen in its documentation, \pkg{zref-clever}
presumes the \emph{type} to be the same as the \emph{counter} unless
instructed otherwise by that option. This association, as determined by the
-local value of the option, affects how the \emph{label} is set, which stores
-the type among its properties. However, when it comes to typesetting, that is
+local value of the option, affects how the \cs{label} is set, which stores the
+type among its properties. However, when it comes to typesetting, that is
from the perspective of \cs{zcref}, only the \emph{type} matters. In other
words, how the reference is supposed to be typeset is determined at the point
-the \emph{label} gets set. In sum, they may be namesakes (or not), but type
-is type and counter is counter.
+the \cs{label} gets set. In sum, they may be namesakes (or not), but type is
+type and counter is counter.
Indeed, a reference type can be associated with multiple counters because we
may want to refer to different document elements, with different
@@ -1043,7 +982,6 @@
Notably, the environments created with \LaTeX{}'s \cs{newtheorem} command and
the \cs{appendix}.
-
One more observation about ``reference types'' is due here. A \emph{type} is
not really ``defined'' in the sense a variable or a function is. It is more
of a ``name'' which \pkg{zref-clever} uses to look for a whole set of
@@ -1056,7 +994,7 @@
\section{Reference format}
-\zlabel{sec:reference-format}
+\label{sec:reference-format}
Formatting how the reference is to be typeset is, quite naturally, a big part
of the user interface of \pkg{zref-clever}. In this area, we tried to balance
@@ -1142,7 +1080,7 @@
\bottomrule
\end{tabular}
\caption{Reference format options and their scopes}
- \zlabel{tab:reference-format}
+ \label{tab:reference-format}
\end{table}
@@ -1325,7 +1263,7 @@
\bottomrule
\end{tabular}
\caption{Advanced reference format options and their scopes}
- \zlabel{tab:advanced-reference-format}
+ \label{tab:advanced-reference-format}
\end{table}
The ``base'' options are the actually operative ones, while the ``derived''
@@ -1364,7 +1302,7 @@
\section{Internationalization}
-\zlabel{sec:internationalization}
+\label{sec:internationalization}
\pkg{zref-clever} provides internationalization facilities and integrates with
\pkg{babel} and \pkg{polyglossia} to adapt to the languages in use by either
@@ -1437,7 +1375,7 @@
\bottomrule
\end{tabular}
\caption{Declared languages and aliases}
- \zlabel{tab:languages-and-aliases}
+ \label{tab:languages-and-aliases}
\end{table}
@@ -1493,7 +1431,7 @@
\bottomrule
\end{tabular}
\caption{Options for declared languages}
- \zlabel{tab:language-options}
+ \label{tab:language-options}
\end{table}
\begin{function}{\zcDeclareLanguageAlias}
@@ -1677,7 +1615,7 @@
\section{How-tos}
-\zlabel{sec:how-tos}
+\label{sec:how-tos}
This section gathers some usage examples, or ``how-tos'', of cases which may
require some \pkg{zref-clever} setup, or usage adjustments, and each item is
@@ -1701,21 +1639,21 @@
\usepackage{zref-vario}
\begin{document}
\section{Section 1}
-\zlabel{sec:section-1}
+\label{sec:section-1}
\begin{figure}
A figure.
\caption{Figure 1}
- \zlabel{fig:figure-1}
+ \label{fig:figure-1}
\end{figure}
\begin{figure}
Another figure.
\caption{Figure 2}
- \zlabel{fig:figure-2}
+ \label{fig:figure-2}
\end{figure}
-\zvref[S]{sec:section-1}
-\zvpageref{fig:figure-1}
-\zvrefrange{fig:figure-1}{fig:figure-2}
-\zvpagerefrange{fig:figure-1}{fig:figure-2}
+\zvref[S]{sec:section-1}\par
+\zvpageref{fig:figure-1}\par
+\zvrefrange{fig:figure-1}{fig:figure-2}\par
+\zvpagerefrange{fig:figure-1}{fig:figure-2}\par
\zfullref{fig:figure-1}
\end{document}
\end{zchowto}
@@ -1728,13 +1666,14 @@
can do in this regard is to provide some ``typical'' built-in reference types
to smooth user setup but, in the general case, some user setup may be indeed
required. The examples below are equaly valid for \pkg{amsthm}'s
-\cs{newtheorem} since, even it provides features beyond those available in the
-kernel, its syntax and underlying relation with counters is pretty much the
-same. The same for \pkg{ntheorem}. For \pkg{thmtools}' \cs{declaretheorem},
-though some adjustments to the examples below may be required, the basic logic
-is the same (there is no integration with the \opt{Refname}, \opt{refname},
-and \opt{label} options, which are targeted to the standard reference system,
-but you don't actually need them to get things working conveniently).
+\cs{newtheorem} since, even if it provides features beyond those available in
+the kernel, its syntax and underlying relation with counters is pretty much
+the same. The same for \pkg{ntheorem}. For \pkg{thmtools}'
+\cs{declaretheorem}, though some adjustments to the examples below may be
+required, the basic logic is the same (there is no integration with the
+\opt{Refname}, \opt{refname}, and \opt{label} options, which are targeted to
+the standard reference system, but you don't actually need them to get things
+working conveniently).
\subsubsection*{Simple case}
@@ -1761,7 +1700,7 @@
\newtheorem{lemma}{Lemma}[section]
\begin{document}
\section{Section 1}
-\begin{lemma}\zlabel{lemma-1}
+\begin{lemma}\label{lemma-1}
A lemma.
\end{lemma}
\zcref{lemma-1}
@@ -1780,7 +1719,7 @@
\newtheorem{lem}{Lemma}[section]
\begin{document}
\section{Section 1}
-\begin{lem}\zlabel{lemma-1}
+\begin{lem}\label{lemma-1}
A lemma.
\end{lem}
\zcref{lemma-1}
@@ -1814,10 +1753,10 @@
\newtheorem{myproposition}[mytheorem]{Proposition}
\begin{document}
\section{Section 1}
-\begin{mytheorem}\zlabel{theorem-1}
+\begin{mytheorem}\label{theorem-1}
A theorem.
\end{mytheorem}
-\begin{myproposition}\zlabel{proposition-1}
+\begin{myproposition}\label{proposition-1}
A proposition.
\end{myproposition}
\zcref{theorem-1, proposition-1}
@@ -1853,7 +1792,7 @@
}
\begin{document}
\section{Section 1}
-\begin{myconjecture}\zlabel{conjecture-1}
+\begin{myconjecture}\label{conjecture-1}
A conjecture.
\end{myconjecture}
\zcref{conjecture-1}
@@ -1891,7 +1830,7 @@
\begin{diagram}
A diagram.
\caption{A diagram}
- \zlabel{diagram-1}
+ \label{diagram-1}
\end{diagram}
\zcref{diagram-1}
\end{document}
@@ -1898,52 +1837,6 @@
\end{zchowto}
-\subsection{\pkg{amsmath}}
-
-\zctask{Make references to \pkg{amsmath} display math environments.}
-
-\pkg{amsmath}'s display math environments have their contents processed twice,
-once for measuring and the second does the final typesetting. Hence,
-\pkg{amsmath} needs to handle \cs{label} specially inside these environments,
-otherwise we'd have duplicate labels all around, and indeed it does redefine
-\cs{label} locally inside them. Alas, the same treatment is not granted to
-\cs{zlabel}. Therefore, you must use \cs{label} (not \cs{zlabel}) inside
-\pkg{amsmath}'s display math environments, and the \opt{labelhook} option
-provides that a \cs{label} sets both a regular \cs{label} and a \cs{zlabel},
-so that we can refer to the equations with both referencing systems. The
-following environments are subject to this usage restriction: \env{equation},
-\env{align}, \env{alignat}, \env{flalign}, \env{xalignat}, \env{gather},
-\env{multline}, and their respective starred versions. For more details, see
-the description of the \opt{amsmath} compatibility module at
-\zcref{sec:comp-modules}.
-
-\begin{zchowto}[caption={\pkg{amsmath}},label={how:amsmath}]
-\documentclass{article}
-\usepackage{amsmath}
-\usepackage{zref-clever}
-\usepackage{hyperref}
-\begin{document}
-\section{Section 1}
-\begin{equation}\label{eq:1}
- A^{(1)}_l =\begin{cases} n!,&\text{if }l =1\\
- 0,&\text{otherwise}.\end{cases}
-\end{equation}
-\begin{equation*} \tag{foo}\label{eq:2}
- A^{(1)}_l =\begin{cases} n!,&\text{if }l =1\\
- 0,&\text{otherwise}.\end{cases}
-\end{equation*}
-\begin{subequations}\label{eq:3}
- \begin{align}
- A+B&=B+A\\
- C&=D+E\label{eq:3b}\\
- E&=F
- \end{align}
-\end{subequations}
-\zcref{eq:1, eq:2, eq:3, eq:3b}
-\end{document}
-\end{zchowto}
-
-
\subsection{Overriding the reference type}
\zctask{Make references to a system of equations, which should be referred to
@@ -1970,7 +1863,7 @@
\section{Section 1}
\begin{equation}
\zcsetup{reftype=pluralequation}
- \zlabel{eq:1}
+ \label{eq:1}
\begin{aligned}
A+B&=B+A\\
C&=D+E\\
@@ -1982,39 +1875,6 @@
\end{zchowto}
-\subsection{\pkg{listings}}
-
-\zctask{Make references to a \env{lstlisting} environment from the
- \pkg{listings} package.}
-
-Being \env{lstlisting} a verbatim environment, setting labels inside it
-requires special treatment. \pkg{zref-clever}'s \opt{labelhook} option
-provides that a label given to the \opt{label} option gets set with both a
-regular \cs{label} and a \cs{zlabel}, so that we can refer to it with both
-referencing systems. Setting labels for specific lines of the environment can
-be done with \cs{zlabel} directly, subject to the same escaping as for the
-standard \cs{label}. For more details, see the description of the
-\opt{listings} compatibility module at \zcref{sec:comp-modules}.
-
-\begin{zchowto}[caption={\pkg{listings}},label={how:listings},escapeinside=`']
-\documentclass{article}
-\usepackage{listings}
-\usepackage{zref-clever}
-\usepackage{hyperref}
-\begin{document}
-\section{Section 1}
-\lstset{escapeinside={(*@}{@*)}, numbers=left, numberstyle=\tiny}
-\begin{lstlisting}[caption={Useless code}, label=lst:1]
- for i:=maxint to 0 do
- begin
- { do nothing }(*@\zlabel{ln:1.1}@*)
- end;
-\end{lstlisting}
-\zcref{lst:1, ln:1.1}
-\end{document}
-\end{zchowto}
-
-
\subsection{\pkg{enumitem}}
\zctask{Setup a custom enumerate environment created with \pkg{enumitem} to be
@@ -2052,13 +1912,13 @@
\setlist[myenumerate,4]{label=(\roman*)}
\begin{document}
\begin{myenumerate}
-\item An item.\zlabel{item-1}
+\item An item.\label{item-1}
\begin{myenumerate}
- \item An item.\zlabel{item-2}
+ \item An item.\label{item-2}
\begin{myenumerate}
- \item An item.\zlabel{item-3}
+ \item An item.\label{item-3}
\begin{myenumerate}
- \item An item.\zlabel{item-4}
+ \item An item.\label{item-4}
\end{myenumerate}
\end{myenumerate}
\end{myenumerate}
@@ -2101,7 +1961,7 @@
\usepackage{hyperref}
\begin{document}
\section{Section A1}
-\zlabel{sec:section-a1}
+\label{sec:section-a1}
\zcref{sec:section-a1, B-sec:section-b1}
\end{document}
`\vspace{-1ex}'
@@ -2111,7 +1971,7 @@
\usepackage{hyperref}
\begin{document}
\section{Section B1}
-\zlabel{sec:section-b1}
+\label{sec:section-b1}
\end{document}
\end{zchowto}
@@ -2120,12 +1980,14 @@
\zctask{Make references to boxes from the \pkg{tcolorbox} package.}
-Since version 6.0.0, \pkg{tcolorbox} has support for \pkg{zref} and
-\pkg{zref-clever}, through the \opt{label is zlabel} option. With this option
-enabled, the \opt{label} option sets a \cs{zlabel}, which can be referred to
-from \cs{zref} or \cs{zcref}. If you are using the \opt{auto counter}, or
-some other custom counter, you can set the reference type for the box's labels
-with the \opt{label type} option.
+\pkg{tcolorbox} has support for \pkg{zref} and \pkg{zref-clever}, hence
+setting labels with the \opt{label} option works out of the box (as long as
+\opt{labelhook} is enabled). If you are using the \opt{auto counter}, or some
+other custom counter, \pkg{tcolorbox}'s \opt{label type} option can be used to
+set \pkg{zref-clever}'s \opt{reftype} for the relevant scope. Furthermore,
+those who prefer to work with \cs{zlabel}s only can set the \opt{label is
+ zlabel} option, which makes the \opt{label} option set a \cs{zlabel}
+directly.
\begin{zchowto}[caption={\pkg{tcolorbox}}]
\documentclass{article}
@@ -2133,7 +1995,6 @@
\usepackage{zref-titleref}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
-\tcbset{label is zlabel}
\usepackage{hyperref}
\newtcolorbox[auto counter,number within=section]{pabox}[2][]{%
label type=example,
@@ -2151,7 +2012,7 @@
}
\begin{document}
\section{Section 1}
-\zlabel{sec:section-1}
+\label{sec:section-1}
\begin{pabox}[label={box:1}]{Title text}
This is tcolorbox \zcref{box:1} on \zcpageref{box:1}.
\end{pabox}
@@ -2166,48 +2027,6 @@
\end{zchowto}
-\subsection{\pkg{breqn}}
-
-\zctask{Make references to \pkg{breqn} math environments.}
-
-\pkg{breqn}'s math environments \env{dgroup}, \env{dmath}, \env{dseries}, and
-\env{darray} offer a \opt{label} option (plus \opt{labelprefix}) for the
-purpose of label setting. \pkg{breqn}'s documentation says the following
-about the use of \cs{label} inside its environments: \textquote{Use of the
- normal \cs{label} command instead of the \opt{label} option works, I think,
- most of the time (untested)}. My light testing suggests the same is true
-for \cs{zlabel}, which can then be used directly in these environments.
-Either way, given the \opt{labelhook} option, we can just use \pkg{breqn}'s
-\opt{label} option and be at ease. Also, \pkg{breqn} does not use
-\cs{refstepcounter} to increment the equation counters and, as a result, fails
-to set \pkg{hyperref} anchors for the equations (thus affecting standard
-labels too). You may wish to use the work-around provided by Heiko Oberdiek
-at \url{https://tex.stackexchange.com/a/241150}.
-
-\begin{zchowto}[caption={\pkg{breqn}},label={how:breqn}]
-\documentclass{article}
-\usepackage{zref-clever}
-\usepackage{breqn}
-\usepackage{hyperref}
-% From https://tex.stackexchange.com/a/241150.
-\usepackage{etoolbox}
-\makeatletter
-\patchcmd\eq at setnumber{\stepcounter}{\refstepcounter}{}{%
- \errmessage{Patching \noexpand\eq at setnumber failed}}
-\makeatother
-\begin{document}
-\section{Section 1}
-\begin{dmath}[label={eq:1}]
- f(x)=\frac{1}{x} \condition{for $x\neq 0$}
-\end{dmath}
-\begin{dmath}[labelprefix={eq:},label={2}]
- H_2^2 = x_1^2 + x_1 x_2 + x_2^2 - q_1 - q_2
-\end{dmath}
-\zcref{eq:1, eq:2}
-\end{document}
-\end{zchowto}
-
-
\subsection{Ordinal references}
\zctask{Typesetting the references as ordinal numbers.}
@@ -2232,11 +2051,11 @@
\zcsetup{ref=ordref}
\begin{document}
\section{Section 1}
-\zlabel{sec:section-1}
+\label{sec:section-1}
\begin{figure}
A figure.
\caption{Figure 1}
-\zlabel{fig:figure-1}
+\label{fig:figure-1}
\end{figure}
\zcref{sec:section-1,fig:figure-1}
\end{document}
@@ -2243,8 +2062,50 @@
\end{zchowto}
+\section{\cs{label} or \cs{zlabel}?}
+\label{sec:label-or-zlabel}
+
+TL;DR: Just use \cs{label}, unless you have special requirements.
+
+\medskip{}
+
+Technically, \pkg{zref}'s referencing system, and thus also \pkg{zref-clever},
+require a label set with \cs{zlabel} to make a reference. However, the
+\opt{labelhook} option (see \zcref{sec:options}) leverages the kernel's
+\texttt{label} hook to also set a \cs{zlabel} when a standard \cs{label} is
+called, so that we can simply use \cs{label}s in our document and refer to
+them with either referencing system. Indeed, in some places the use of
+\cs{label} this way may be required. That given, which is to be preferred:
+use \cs{label} all around or normally use \cs{zlabel} and, occasionally resort
+to \cs{label} where required? I guess it depends, but we can reason the pros
+and cons of both alternatives.
+
+Simply using \cs{label} across your document clearly speaks for convenience.
+You don't have to worry with the exceptional case where a \cs{zlabel} may not
+work or setting it is not possible. You can use either referencing system for
+your labels as desired. Your favorite editor may have some facilities to ease
+the insertion of labels, but does not support \cs{zlabel}. And so on. The
+only disadvantage I can see with this approach is that two labels end up in
+the \file{.aux} file which, arguably, may be seen as a redundancy, or waste.
+
+It is probably fair to consider this redundancy, in most use cases, as a
+negligible cost. But you may disagree, or the size of your document or your
+requirements may say otherwise, in which case you may prefer the second
+approach and use \cs{zlabel} normally, with some occasional \cs{label} where
+required. Outright disabling the \opt{labelhook} option leaves you uncovered
+in such cases, but you can always locally (re-)enable it as needed. As far as
+my experience goes, the restrictions should not be that many, and some trial
+and error can easily tell what the situation is. See
+\zcref{sec:limitations,sec:comp-modules} for some discussion and known cases.
+
+All in all, as far as \pkg{zref-clever} is concerned, the use of \cs{label}
+throughout (with the \opt{labelhook} option) is the recommended approach.
+Consider the use of \cs{zlabel} directly if you have some special requirements
+at stake and are willing to handle a few rough edges.
+
+
\section{Limitations}
-\zlabel{sec:limitations}
+\label{sec:limitations}
Being based on \pkg{zref} entails one significant advantage for
\pkg{zref-clever}: the extensible referencing system of the former allows
@@ -2252,12 +2113,13 @@
without having to redefine some core \LaTeX{} commands. Which leads to less
compatibility problems and load order issues than some traditional
cross-reference related packages. On the other hand, being based on
-\pkg{zref} also does impair the supported scope of \pkg{zref-clever}. Not
-because of any particular limitation of either, but because any class or
-package which implements some special handling for reference labels
-universally does so aiming at the standard referencing system, and whether
-specific support for \pkg{zref} is included, or whether things work by
-spillover of the particular technique employed, is not guaranteed.
+\pkg{zref} also has some potential implications to the supported scope of
+\pkg{zref-clever}. Not because of any particular limitation of either, but
+because any class or package which implements some special handling for
+reference labels universally does so aiming at the standard referencing
+system, and whether specific support for \pkg{zref} is included, or whether
+things work by spillover of the particular technique employed, is not
+guaranteed.
The limitation here is less one of \pkg{zref-clever} than that of a potencial
lack of support for \pkg{zref} itself. Broadly speaking, what
@@ -2291,9 +2153,7 @@
in the 2023-06-01 release improves the situation considerably.
\pkg{zref-clever} makes use of it with the \opt{labelhook} option, enabled by
default, so that a standard \cs{label} also sets a \cs{zlabel} with the same
-name, thus providing a very general and reliable way to deal with these places
-where setting a \cs{zlabel} directly is problematic: just set a standard
-label.
+name, thus providing a very general and reliable way to deal with this issue.
Regarding the second, a correctly set \cs{@currentcounter} is critical for the
task of \pkg{zref-clever}: the reference type will depend on that and,
@@ -2303,23 +2163,22 @@
\cs{@currentlabel} and, since the 2021-11-15 release, the support for
\cs{@currentcounter} has been further extended in the kernel. Hence, as long
as kernel features are involved, or as long as \cs{refstepcounter} is the tool
-used for the purpose of reference setting, \cs{zlabel} will tend to have all
-information within its grasp at label setting time. But that's not always the
-case. For this reason, \pkg{zref-clever} has the option \opt{currentcounter}
-which at least allows for some viable work-arounds when the value of
-\cs{@currentcounter} cannot be relied upon. Whether we have a proper opening
-to set it, depends on the case. Still, \cs{refstepcounter} is ubiquitous
-enough a tool that we can count on \cs{@currentcounter} most of the time.
+used for the purpose of reference setting, the label will tend to have all
+information within its grasp at the time it is set. But that's not
+necessarily always the case. For this reason, \pkg{zref-clever} has the
+option \opt{currentcounter} which at least allows for some viable work-arounds
+when the value of \cs{@currentcounter} cannot be relied upon. Whether we have
+a proper opening to set it, depends on the case. Still, \cs{refstepcounter}
+is ubiquitous enough a tool that we can count on \cs{@currentcounter} most of
+the time.
-All in all, most things work, but some things may not. And if the later will
-eventually work depends essentially on whether support for \pkg{zref} is
-provided by the relevant packages and classes or not. Or, failing that,
-whether \pkg{zref-clever} is able to provide some specific support when a
-reasonable way to do so is within reach.
+All in all, specially since the kernel's \texttt{label} hook has been made
+available, we can expect to find very little trouble in setting proper labels
+for \pkg{zref-clever}. Which is not to say ``none'', of course.
\section{Compatibility modules}
-\zlabel{sec:comp-modules}
+\label{sec:comp-modules}
This section gives a description of each compatibility module provided by
\pkg{zref-clever}. These modules intend to smooth the interaction of \LaTeX{}
@@ -2329,8 +2188,7 @@
``the list of packages or classes supported by \pkg{zref-clever}''. In most
circumstances, things should just work out of the box, and need no specific
handling. These are just the ones for which some special treatment was
-required. Of course, this effort is bound to be incomplete (see
-\zcref{sec:limitations}).
+required.
Note that settings performed by the compatibility modules require special care
if they are to be changed by users. Since the modules depend on what has been
@@ -2340,13 +2198,13 @@
e.g.\ by adding their setting to the \texttt{begindocument} hook.
The purpose of outlining to some extend what the compatibility modules do is
-twofold. First, some of them require usage adjustments for label setting,
+twofold. First, some of them may require usage adjustments, or awareness,
which must be somehow conveyed in this documentation. Second, the kind and
-degree of intervention in external code varies significantly for each module,
-and since this is an area of potential friction, a minimum of information for
-the users to judge whether they want to leave these modules enabled or not is
-due. For this reason, this is also a little technical, but for full details,
-see the code documentation.
+degree of intervention in external code varies for each module, and since this
+is an area of potential friction, a minimum of information for the users to
+judge whether they want to leave these modules enabled or not is due. For
+this reason, this is also a little technical, but for more details, see the
+code documentation.
\bigskip{}
@@ -2381,17 +2239,28 @@
\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}.
+\pkg{zref} property ``\texttt{subcaption}'' so that we can use
+\texttt{ref=subcaption} to emulate the functionality of \cls{memoir}'s
+\cs{subcaptionref}.
\DescribeOption{amsmath} %
-The module ensures proper \opt{currentcounter} values are in place for the
-display math environments, for which it uses environment hooks. The module
-also provides a \texttt{subeq} property, for display math environments used
-inside the \env{subequations} environment, which can be used to refer to them
-directly with the \opt{ref} option, or to build terse ranges with the
-\opt{endrange} option.
+\pkg{amsmath}'s display math environments have their contents processed twice,
+once for measuring and the second does the final typesetting. Hence,
+\pkg{amsmath} needs to handle \cs{label} specially inside these environments,
+otherwise we'd have duplicate labels all around, and indeed it does redefine
+\cs{label} locally inside them. Alas, the same treatment is not granted to
+\cs{zlabel}. Therefore, you must use \cs{label} (not \cs{zlabel}) inside
+\pkg{amsmath}'s display math environments, but unless you disabled the
+\opt{labelhook} option you need not worry about that, and can just go with
+\cs{label} as usual. The following environments are subject to this usage
+restriction: \env{equation}, \env{align}, \env{alignat}, \env{flalign},
+\env{xalignat}, \env{gather}, \env{multline}, and their respective starred
+versions. Besides that, the module ensures proper \opt{currentcounter} values
+are in place for the display math environments, for which it uses environment
+hooks. The module also provides a \texttt{subeq} property, for display math
+environments used inside the \env{subequations} environment, which can be used
+to refer to them directly with the \opt{ref} option, or to build terse ranges
+with the \opt{endrange} option.
\DescribeOption{mathtools} %
\pkg{mathtools} has a feature to show the numbers only for those equations
@@ -2399,21 +2268,30 @@
\opt{showonlyrefs} option. This compatibility module adds support for this
feature, such that equation references made with \cs{zcref} also get marked as
``referenced'' for \pkg{mathtools}, when the option is active, of course. The
-module uses a couple of \pkg{mathtools} functions, but does not need to
-redefine or hook into anything, everything is handled on \pkg{zref-clever}'s
-side.
+module uses \pkg{mathtools}' \cs{noeqref} for the purpose, but does not need
+to redefine or hook into anything, everything is handled on
+\pkg{zref-clever}'s side.
\DescribeOption{breqn} %
This compatibility module only sets proper \opt{currentcounter} values for the
environments \env{dgroup}, \env{dmath}, \env{dseries}, and \env{darray}, and
-uses environment hooks for the purpose. See the \zcref{how:breqn} for an
-usage example.
+uses environment hooks for the purpose. Note that, in part, this is needed
+because \pkg{breqn} does not use \cs{refstepcounter} to increment the equation
+counters and, as a result, fails to set \cs{@currentcounter}. But, for the
+same reason, it also fails to set \pkg{hyperref} anchors for the equations
+(thus affecting the standard labels too). So, you may wish to use the
+work-around provided by Heiko Oberdiek at
+\url{https://tex.stackexchange.com/a/241150} (or equivalent).
\DescribeOption{listings} %
-The module sets appropriate \opt{countertype}, \opt{counterresetby} and
-\opt{currentcounter} values for the \pkg{listings}' counters:
-\texttt{lstlisting} and \texttt{lstnumber}. See the \zcref{how:listings} for
-an usage example.
+Being \env{lstlisting} a verbatim environment, setting labels inside it
+requires special treatment. \pkg{zref-clever}'s \opt{labelhook} option
+provides that a label given to the \opt{label} works out of the box, so unless
+you disabled the \opt{labelhook} option you need not worry about it. Setting
+labels for specific lines of the environment can also be done, subject to
+escaping as due. The module sets appropriate \opt{countertype},
+\opt{counterresetby} and \opt{currentcounter} values for the \pkg{listings}'
+counters: \texttt{lstlisting} and \texttt{lstnumber}.
\DescribeOption{enumitem} %
\LaTeX{}'s \env{enumerate} environment requires some special treatment from
@@ -2446,22 +2324,19 @@
\section{Work-arounds}
-\marginpar{\raggedleft\raisebox{-1.5ex}{\dbend}}As should be clear by now, the
-use of \pkg{zref}'s \cs{zlabel} and thus of \pkg{zref-clever} may occasionally
-require some adjustments, since it does not enjoy the universal support the
-standard referencing system does. The compatibility modules presented in
-\zcref{sec:comp-modules} go a long way in ensuring the user has to worry very
-little about it, but they cannot be expected to go all the way. Not only
-because this kind of support will never be exhaustive, but also since,
-sometimes, given the way certain features are implemented by packages or
-document classes, there may not be a reasonable way to provide this support,
-from our side. But, still, most of the time, it is still ``viable'' to get
-there, if one really wishes to do so. So, this section keeps track of some
-known recipes, which I don't think belong in \pkg{zref-clever} itself, but
-which you may choose to use. Note that this list is intended to spare users
-from having to reinvent the wheel every time someone needs something of the
-sort, but from \pkg{zref-clever}'s perspective, their status is ``not
-supported''.
+\marginpar{\raggedleft\raisebox{-1.5ex}{\dbend}}The compatibility modules
+presented in \zcref{sec:comp-modules} should go a long way in ensuring the
+user has little to worry about in setting up \pkg{zref-clever} for some more
+traditional document classes and packages, but they cannot be expected to go
+all the way. Not only because this kind of support will never be exhaustive,
+but also since, sometimes, given the way certain features are implemented,
+there may not be a reasonable way to provide this support, from our side.
+But, still, most of the time, it is still ``viable'' to get there, if one
+really wishes to do so. So, this section keeps track of some known recipes,
+which I don't think belong in \pkg{zref-clever} itself, but which you may
+choose to use. Note that this list is intended to spare users from having to
+reinvent the wheel every time someone needs something of the sort, but from
+\pkg{zref-clever}'s perspective, their status is ``not supported''.
\subsection*{\cls{beamer}}
@@ -2700,3 +2575,7 @@
package is also kept at \url{https://github.com/gusbrs/zref-clever/releases}.
\end{document}
+
+% Local Variables:
+% TeX-engine: luatex
+% End:
Modified: trunk/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx 2024-11-08 22:05:35 UTC (rev 72797)
+++ trunk/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx 2024-11-08 22:05:45 UTC (rev 72798)
@@ -66,6 +66,7 @@
% \DoNotIndex{\\,\{,\}}
% \DoNotIndex{\c@,\cl@,\c at enumN,\p@}
% \DoNotIndex{\the}
+% \DoNotIndex{\A,\Z,\d}
%
% \NewDocumentCommand\githubissue{m}{^^A
% issue~\href{https://github.com/gusbrs/zref-clever/issues/#1}{\##1}}
@@ -171,7 +172,7 @@
%
% Identify the package.
% \begin{macrocode}
-\ProvidesExplPackage {zref-clever} {2024-09-30} {0.4.7}
+\ProvidesExplPackage {zref-clever} {2024-11-07} {0.4.8}
{Clever LaTeX cross-references based on zref}
% \end{macrocode}
%
@@ -413,13 +414,6 @@
}
% \end{macrocode}
%
-% Both \texttt{e} and \texttt{f} expansions work for this particular recursive
-% call. I'll stay with the \texttt{e} variant, since conceptually it is what
-% I want (\texttt{x} itself is not expandable), and this package is anyway not
-% compatible with older kernels for which the performance penalty of the
-% \texttt{e} expansion would ensue (helpful comment by \contributor{Enrico
-% Gregorio}, aka `egreg' at
-% \url{https://tex.stackexchange.com/q/611370/#comment1529282_611385}).
% \begin{macrocode}
\cs_generate_variant:Nn \@@_get_enclosing_counters:n { e }
\cs_generate_variant:Nn \@@_get_enclosing_counters_value:n { e }
@@ -473,7 +467,7 @@
\zref at newprop { zc at enclval }
{
\@@_get_enclosing_counters_value:e
- \l_@@_current_counter_tl
+ { \l_@@_current_counter_tl }
}
\zref at addprop \ZREF at mainlist { zc at enclval }
% \end{macrocode}
@@ -504,8 +498,8 @@
% \texttt{abspage} which solves this problem. But we can decide whether two
% labels can be compressed into a range or not based on this format: if they
% are identical, we can compress them, otherwise, we can't. However,
-% \texttt{x} expanding \cs{thepage} can lead to errors for some \pkg{babel}
-% packages which redefine \cs{roman} containing non-expandable material (see
+% expanding \cs{thepage} can lead to errors for some \pkg{babel} packages
+% which redefine \cs{roman} containing non-expandable material (see
% \url{https://chat.stackexchange.com/transcript/message/63810027#63810027},
% \url{https://chat.stackexchange.com/transcript/message/63810318#63810318},
% \url{https://chat.stackexchange.com/transcript/message/63810720#63810720}
@@ -773,9 +767,9 @@
%
% \begin{macro}{\@@_extract_unexp:nnn}
% Extract property \meta{prop} from \meta{label}. Ensure that, in the
-% context of an x expansion, \cs{zref at extractdefault} is expanded exactly
+% context of an e expansion, \cs{zref at extractdefault} is expanded exactly
% twice, but no further to retrieve the proper value. Thus, this is meant
-% to be use in an x expansion context, not in other situations. In case the
+% to be use in an e expansion context, not in other situations. In case the
% property is not found, leave \meta{default} in the stream.
% \begin{syntax}
% \cs{@@_extract_unexp:nnn}\Arg{label}\Arg{prop}\Arg{default}
@@ -1639,7 +1633,7 @@
\tl_new:N \l_@@_main_language_tl
% \end{macrocode}
%
-% \begin{macro}{\l_zrefclever_ref_language_tl}
+% \begin{macro}[int]{\l_zrefclever_ref_language_tl}
% A public version of \cs{l_@@_ref_language_tl} for use in \pkg{zref-vario}.
% \begin{macrocode}
\tl_new:N \l_zrefclever_ref_language_tl
@@ -1661,7 +1655,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[EXP]{\zrefclever_language_varname:n}
+% \begin{macro}[EXP,int]{\zrefclever_language_varname:n}
% A public version of \cs{@@_language_varname:n} for use in
% \pkg{zref-vario}.
% \begin{macrocode}
@@ -1681,8 +1675,8 @@
\prg_new_conditional:Npnn \@@_language_if_declared:n #1 { T , F , TF }
{
\tl_if_exist:cTF { \@@_language_varname:n {#1} }
- { \prg_return_true: }
- { \prg_return_false: }
+ { \prg_return_true: }
+ { \prg_return_false: }
}
\prg_generate_conditional_variant:Nnn
\@@_language_if_declared:n { e } { T , F , TF }
@@ -1689,7 +1683,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[EXP,TF]{\zrefclever_language_if_declared:n}
+% \begin{macro}[EXP,TF,int]{\zrefclever_language_if_declared:n}
% A public version of \cs{@@_language_if_declared:n} for use in
% \pkg{zref-vario}.
% \begin{macrocode}
@@ -1726,17 +1720,17 @@
\NewDocumentCommand \zcDeclareLanguage { O { } m }
{
\group_begin:
- \tl_if_empty:nF {#2}
- {
- \@@_language_if_declared:nTF {#2}
- { \msg_warning:nnn { zref-clever } { language-declared } {#2} }
- {
- \tl_new:c { \@@_language_varname:n {#2} }
- \tl_gset:cn { \@@_language_varname:n {#2} } {#2}
- \tl_set:Nn \l_@@_setup_language_tl {#2}
- \keys_set:nn { zref-clever/declarelang } {#1}
- }
- }
+ \tl_if_empty:nF {#2}
+ {
+ \@@_language_if_declared:nTF {#2}
+ { \msg_warning:nnn { zref-clever } { language-declared } {#2} }
+ {
+ \tl_new:c { \@@_language_varname:n {#2} }
+ \tl_gset:cn { \@@_language_varname:n {#2} } {#2}
+ \tl_set:Nn \l_@@_setup_language_tl {#2}
+ \keys_set:nn { zref-clever/declarelang } {#1}
+ }
+ }
\group_end:
}
\@onlypreamble \zcDeclareLanguage
@@ -2036,51 +2030,51 @@
\cs_new_protected:Npn \@@_provide_langfile:n #1
{
\group_begin:
- \@bsphack
- \@@_language_if_declared:nT {#1}
- {
- \seq_if_in:NeF
- \g_@@_loaded_langfiles_seq
- { \tl_use:c { \@@_language_varname:n {#1} } }
- {
- \exp_args:Ne \file_get:nnNTF
- {
- zref-clever-
- \tl_use:c { \@@_language_varname:n {#1} }
- .lang
- }
- { \ExplSyntaxOn }
- \l_@@_tmpa_tl
- {
- \tl_set:Nn \l_@@_setup_language_tl {#1}
- \tl_clear:N \l_@@_setup_type_tl
- \@@_opt_seq_get:cNF
- {
- \@@_opt_varname_language:nnn
- {#1} { declension } { seq }
- }
- \l_@@_lang_declension_seq
- { \seq_clear:N \l_@@_lang_declension_seq }
- \seq_if_empty:NTF \l_@@_lang_declension_seq
- { \tl_clear:N \l_@@_lang_decl_case_tl }
- {
- \seq_get_left:NN \l_@@_lang_declension_seq
- \l_@@_lang_decl_case_tl
- }
- \@@_opt_seq_get:cNF
- {
- \@@_opt_varname_language:nnn
- {#1} { gender } { seq }
- }
- \l_@@_lang_gender_seq
- { \seq_clear:N \l_@@_lang_gender_seq }
- \keys_set:nV { zref-clever/langfile } \l_@@_tmpa_tl
- \seq_gput_right:Ne \g_@@_loaded_langfiles_seq
- { \tl_use:c { \@@_language_varname:n {#1} } }
- \msg_info:nne { zref-clever } { langfile-loaded }
- { \tl_use:c { \@@_language_varname:n {#1} } }
- }
- {
+ \@bsphack
+ \@@_language_if_declared:nT {#1}
+ {
+ \seq_if_in:NeF
+ \g_@@_loaded_langfiles_seq
+ { \tl_use:c { \@@_language_varname:n {#1} } }
+ {
+ \exp_args:Ne \file_get:nnNTF
+ {
+ zref-clever-
+ \tl_use:c { \@@_language_varname:n {#1} }
+ .lang
+ }
+ { \ExplSyntaxOn }
+ \l_@@_tmpa_tl
+ {
+ \tl_set:Nn \l_@@_setup_language_tl {#1}
+ \tl_clear:N \l_@@_setup_type_tl
+ \@@_opt_seq_get:cNF
+ {
+ \@@_opt_varname_language:nnn
+ {#1} { declension } { seq }
+ }
+ \l_@@_lang_declension_seq
+ { \seq_clear:N \l_@@_lang_declension_seq }
+ \seq_if_empty:NTF \l_@@_lang_declension_seq
+ { \tl_clear:N \l_@@_lang_decl_case_tl }
+ {
+ \seq_get_left:NN \l_@@_lang_declension_seq
+ \l_@@_lang_decl_case_tl
+ }
+ \@@_opt_seq_get:cNF
+ {
+ \@@_opt_varname_language:nnn
+ {#1} { gender } { seq }
+ }
+ \l_@@_lang_gender_seq
+ { \seq_clear:N \l_@@_lang_gender_seq }
+ \keys_set:nV { zref-clever/langfile } \l_@@_tmpa_tl
+ \seq_gput_right:Ne \g_@@_loaded_langfiles_seq
+ { \tl_use:c { \@@_language_varname:n {#1} } }
+ \msg_info:nne { zref-clever } { langfile-loaded }
+ { \tl_use:c { \@@_language_varname:n {#1} } }
+ }
+ {
% \end{macrocode}
% Even if we don't have the actual language file, we register it as
% ``loaded''. At this point, it is a known language, properly declared.
@@ -2087,12 +2081,12 @@
% There is no point in trying to load it multiple times, if it was not found
% the first time, it won't be the next.
% \begin{macrocode}
- \seq_gput_right:Ne \g_@@_loaded_langfiles_seq
- { \tl_use:c { \@@_language_varname:n {#1} } }
- }
- }
- }
- \@esphack
+ \seq_gput_right:Ne \g_@@_loaded_langfiles_seq
+ { \tl_use:c { \@@_language_varname:n {#1} } }
+ }
+ }
+ }
+ \@esphack
\group_end:
}
\cs_generate_variant:Nn \@@_provide_langfile:n { e }
@@ -2116,7 +2110,6 @@
{ \tl_clear:N \l_@@_setup_type_tl }
{ \tl_set:Nn \l_@@_setup_type_tl {#1} }
} ,
-
case .code:n =
{
\seq_if_empty:NTF \l_@@_lang_declension_seq
@@ -2136,7 +2129,6 @@
}
} ,
case .value_required:n = true ,
-
gender .value_required:n = true ,
gender .code:n =
{
@@ -2291,7 +2283,6 @@
}
}
}
-
{ stripprefix }
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -2328,7 +2319,6 @@
}
}
}
-
{ pagecomp }
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -2365,7 +2355,6 @@
}
}
}
-
{ pagecomp2 }
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -2791,7 +2780,6 @@
} ,
typeset .initial:n = both ,
typeset .value_required:n = true ,
-
noname .meta:n = { typeset = ref } ,
noname .value_forbidden:n = true ,
noref .meta:n = { typeset = name } ,
@@ -2890,15 +2878,15 @@
% \opt{endrange} was set to \texttt{ref} at some scope which happens to get
% precedence.
%
-% One thing I was divided about in this functionality was whether to
-% (x-)expand the references before processing them, when such processing is
-% required. At first sight, it makes sense to do so, since we are aiming at
-% ``removing common parts'' as close as possible to the printed representation
-% of the references (\pkg{cleveref} does expand them in \cs{crefstripprefix}).
-% On the other hand, this brings some new challenges: if a fragile command
-% gets there, we are in trouble; also, if a protected one gets there, though
-% things won't break as badly, we may ``strip'' the macro and stay with
-% different arguments, which will then end up in the input stream. I think
+% One thing I was divided about in this functionality was whether to expand
+% the references before processing them, when such processing is required. At
+% first sight, it makes sense to do so, since we are aiming at ``removing
+% common parts'' as close as possible to the printed representation of the
+% references (\pkg{cleveref} does expand them in \cs{crefstripprefix}). On
+% the other hand, this brings some new challenges: if a fragile command gets
+% there, we are in trouble; also, if a protected one gets there, though things
+% won't break as badly, we may ``strip'' the macro and stay with different
+% arguments, which will then end up in the input stream. I think
% \pkg{biblatex} is a good reference here, and it offers \cs{NumCheckSetup},
% \cs{NumsCheckSetup}, and \cs{PagesCheckSetup} aimed at locally redefining
% some commands which may interfere with the processing. This is a good idea,
@@ -2929,7 +2917,6 @@
{ endrangeprop } { tl }
}
}
-
{ stripprefix }
{
\@@_opt_tl_set:cn
@@ -2944,7 +2931,6 @@
{ endrangeprop } { tl }
}
}
-
{ pagecomp }
{
\@@_opt_tl_set:cn
@@ -2959,7 +2945,6 @@
{ endrangeprop } { tl }
}
}
-
{ pagecomp2 }
{
\@@_opt_tl_set:cn
@@ -2974,7 +2959,6 @@
{ endrangeprop } { tl }
}
}
-
{ unset }
{
\@@_opt_tl_unset:c
@@ -3049,71 +3033,71 @@
\bool_if:NTF \l_@@_typeset_range_bool
{
\group_begin:
- \bool_set_false:N \l_@@_tmpa_bool
- \exp_args:Nee \tl_if_eq:nnT
- {
- \@@_extract_unexp:nnn
- {#1} { externaldocument } { }
- }
- {
- \@@_extract_unexp:nnn
- {#2} { externaldocument } { }
- }
- {
- \tl_if_eq:NnTF \l_@@_ref_property_tl { page }
- {
- \exp_args:Nee \tl_if_eq:nnT
- {
- \@@_extract_unexp:nnn
- {#1} { zc at pgfmt } { }
- }
- {
- \@@_extract_unexp:nnn
- {#2} { zc at pgfmt } { }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- {
- \exp_args:Nee \tl_if_eq:nnT
- {
- \@@_extract_unexp:nnn
- {#1} { zc at counter } { }
- }
- {
- \@@_extract_unexp:nnn
- {#2} { zc at counter } { }
- }
- {
- \exp_args:Nee \tl_if_eq:nnT
- {
- \@@_extract_unexp:nnn
- {#1} { zc at enclval } { }
- }
- {
- \@@_extract_unexp:nnn
- {#2} { zc at enclval } { }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- }
- }
- \bool_if:NTF \l_@@_tmpa_bool
- {
- \@@_extract_default:Nnvn \l_@@_tmpb_tl
- {#2} { l_@@_endrangeprop_tl } { }
- }
- {
- \zref at ifrefcontainsprop
- {#2} { \l_@@_ref_property_tl }
- {
- \@@_extract_default:Nnvn \l_@@_tmpb_tl
- {#2} { l_@@_ref_property_tl } { }
- }
- { \tl_set:Nn \l_@@_tmpb_tl { zc at missingproperty } }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l_@@_tmpb_tl
+ \bool_set_false:N \l_@@_tmpa_bool
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \@@_extract_unexp:nnn
+ {#1} { externaldocument } { }
+ }
+ {
+ \@@_extract_unexp:nnn
+ {#2} { externaldocument } { }
+ }
+ {
+ \tl_if_eq:NnTF \l_@@_ref_property_tl { page }
+ {
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \@@_extract_unexp:nnn
+ {#1} { zc at pgfmt } { }
+ }
+ {
+ \@@_extract_unexp:nnn
+ {#2} { zc at pgfmt } { }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ {
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \@@_extract_unexp:nnn
+ {#1} { zc at counter } { }
+ }
+ {
+ \@@_extract_unexp:nnn
+ {#2} { zc at counter } { }
+ }
+ {
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \@@_extract_unexp:nnn
+ {#1} { zc at enclval } { }
+ }
+ {
+ \@@_extract_unexp:nnn
+ {#2} { zc at enclval } { }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ }
+ }
+ \bool_if:NTF \l_@@_tmpa_bool
+ {
+ \@@_extract_default:Nnvn \l_@@_tmpb_tl
+ {#2} { l_@@_endrangeprop_tl } { }
+ }
+ {
+ \zref at ifrefcontainsprop
+ {#2} { \l_@@_ref_property_tl }
+ {
+ \@@_extract_default:Nnvn \l_@@_tmpb_tl
+ {#2} { l_@@_ref_property_tl } { }
+ }
+ { \tl_set:Nn \l_@@_tmpb_tl { zc at missingproperty } }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l_@@_tmpb_tl
}
{
\@@_extract_default:Nnvn #3
@@ -3145,36 +3129,36 @@
\zref at ifrefcontainsprop {#2} { \l_@@_ref_property_tl }
{
\group_begin:
- \UseHook { zref-clever/endrange-setup }
- \tl_set:Ne \l_@@_tmpa_tl
- {
- \@@_extract:nnn
- {#1} { \l_@@_ref_property_tl } { }
- }
- \tl_set:Ne \l_@@_tmpb_tl
- {
- \@@_extract:nnn
- {#2} { \l_@@_ref_property_tl } { }
- }
- \bool_set_false:N \l_@@_tmpa_bool
- \bool_until_do:Nn \l_@@_tmpa_bool
- {
- \exp_args:Nee \tl_if_eq:nnTF
- { \tl_head:V \l_@@_tmpa_tl }
- { \tl_head:V \l_@@_tmpb_tl }
- {
- \tl_set:Ne \l_@@_tmpa_tl
- { \tl_tail:V \l_@@_tmpa_tl }
- \tl_set:Ne \l_@@_tmpb_tl
- { \tl_tail:V \l_@@_tmpb_tl }
- \tl_if_empty:NT \l_@@_tmpb_tl
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l_@@_tmpb_tl
+ \UseHook { zref-clever/endrange-setup }
+ \tl_set:Ne \l_@@_tmpa_tl
+ {
+ \@@_extract:nnn
+ {#1} { \l_@@_ref_property_tl } { }
+ }
+ \tl_set:Ne \l_@@_tmpb_tl
+ {
+ \@@_extract:nnn
+ {#2} { \l_@@_ref_property_tl } { }
+ }
+ \bool_set_false:N \l_@@_tmpa_bool
+ \bool_until_do:Nn \l_@@_tmpa_bool
+ {
+ \exp_args:Nee \tl_if_eq:nnTF
+ { \tl_head:V \l_@@_tmpa_tl }
+ { \tl_head:V \l_@@_tmpb_tl }
+ {
+ \tl_set:Ne \l_@@_tmpa_tl
+ { \tl_tail:V \l_@@_tmpa_tl }
+ \tl_set:Ne \l_@@_tmpb_tl
+ { \tl_tail:V \l_@@_tmpb_tl }
+ \tl_if_empty:NT \l_@@_tmpb_tl
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l_@@_tmpb_tl
}
{ \tl_set:Nn #3 { zc at missingproperty } }
}
@@ -3205,42 +3189,42 @@
\zref at ifrefcontainsprop {#2} { \l_@@_ref_property_tl }
{
\group_begin:
- \UseHook { zref-clever/endrange-setup }
- \tl_set:Ne \l_@@_tmpa_tl
- {
- \@@_extract:nnn
- {#1} { \l_@@_ref_property_tl } { }
- }
- \tl_set:Ne \l_@@_tmpb_tl
- {
- \@@_extract:nnn
- {#2} { \l_@@_ref_property_tl } { }
- }
- \bool_set_false:N \l_@@_tmpa_bool
- \@@_is_integer_rgx:VTF \l_@@_tmpa_tl
- {
- \@@_is_integer_rgx:VF \l_@@_tmpb_tl
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- \bool_until_do:Nn \l_@@_tmpa_bool
- {
- \exp_args:Nee \tl_if_eq:nnTF
- { \tl_head:V \l_@@_tmpa_tl }
- { \tl_head:V \l_@@_tmpb_tl }
- {
- \tl_set:Ne \l_@@_tmpa_tl
- { \tl_tail:V \l_@@_tmpa_tl }
- \tl_set:Ne \l_@@_tmpb_tl
- { \tl_tail:V \l_@@_tmpb_tl }
- \tl_if_empty:NT \l_@@_tmpb_tl
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l_@@_tmpb_tl
+ \UseHook { zref-clever/endrange-setup }
+ \tl_set:Ne \l_@@_tmpa_tl
+ {
+ \@@_extract:nnn
+ {#1} { \l_@@_ref_property_tl } { }
+ }
+ \tl_set:Ne \l_@@_tmpb_tl
+ {
+ \@@_extract:nnn
+ {#2} { \l_@@_ref_property_tl } { }
+ }
+ \bool_set_false:N \l_@@_tmpa_bool
+ \@@_is_integer_rgx:VTF \l_@@_tmpa_tl
+ {
+ \@@_is_integer_rgx:VF \l_@@_tmpb_tl
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ \bool_until_do:Nn \l_@@_tmpa_bool
+ {
+ \exp_args:Nee \tl_if_eq:nnTF
+ { \tl_head:V \l_@@_tmpa_tl }
+ { \tl_head:V \l_@@_tmpb_tl }
+ {
+ \tl_set:Ne \l_@@_tmpa_tl
+ { \tl_tail:V \l_@@_tmpa_tl }
+ \tl_set:Ne \l_@@_tmpb_tl
+ { \tl_tail:V \l_@@_tmpb_tl }
+ \tl_if_empty:NT \l_@@_tmpb_tl
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l_@@_tmpb_tl
}
{ \tl_set:Nn #3 { zc at missingproperty } }
}
@@ -3254,49 +3238,49 @@
\zref at ifrefcontainsprop {#2} { \l_@@_ref_property_tl }
{
\group_begin:
- \UseHook { zref-clever/endrange-setup }
- \tl_set:Ne \l_@@_tmpa_tl
- {
- \@@_extract:nnn
- {#1} { \l_@@_ref_property_tl } { }
- }
- \tl_set:Ne \l_@@_tmpb_tl
- {
- \@@_extract:nnn
- {#2} { \l_@@_ref_property_tl } { }
- }
- \bool_set_false:N \l_@@_tmpa_bool
- \@@_is_integer_rgx:VTF \l_@@_tmpa_tl
- {
- \@@_is_integer_rgx:VF \l_@@_tmpb_tl
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- \bool_until_do:Nn \l_@@_tmpa_bool
- {
- \exp_args:Nee \tl_if_eq:nnTF
- { \tl_head:V \l_@@_tmpa_tl }
- { \tl_head:V \l_@@_tmpb_tl }
- {
- \bool_lazy_or:nnTF
- { \int_compare_p:nNn { \l_@@_tmpb_tl } > { 99 } }
- {
- \int_compare_p:nNn
- { \tl_head:V \l_@@_tmpb_tl } = { 0 }
- }
- {
- \tl_set:Ne \l_@@_tmpa_tl
- { \tl_tail:V \l_@@_tmpa_tl }
- \tl_set:Ne \l_@@_tmpb_tl
- { \tl_tail:V \l_@@_tmpb_tl }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- { \bool_set_true:N \l_@@_tmpa_bool }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l_@@_tmpb_tl
+ \UseHook { zref-clever/endrange-setup }
+ \tl_set:Ne \l_@@_tmpa_tl
+ {
+ \@@_extract:nnn
+ {#1} { \l_@@_ref_property_tl } { }
+ }
+ \tl_set:Ne \l_@@_tmpb_tl
+ {
+ \@@_extract:nnn
+ {#2} { \l_@@_ref_property_tl } { }
+ }
+ \bool_set_false:N \l_@@_tmpa_bool
+ \@@_is_integer_rgx:VTF \l_@@_tmpa_tl
+ {
+ \@@_is_integer_rgx:VF \l_@@_tmpb_tl
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ \bool_until_do:Nn \l_@@_tmpa_bool
+ {
+ \exp_args:Nee \tl_if_eq:nnTF
+ { \tl_head:V \l_@@_tmpa_tl }
+ { \tl_head:V \l_@@_tmpb_tl }
+ {
+ \bool_lazy_or:nnTF
+ { \int_compare_p:nNn { \l_@@_tmpb_tl } > { 99 } }
+ {
+ \int_compare_p:nNn
+ { \tl_head:V \l_@@_tmpb_tl } = { 0 }
+ }
+ {
+ \tl_set:Ne \l_@@_tmpa_tl
+ { \tl_tail:V \l_@@_tmpa_tl }
+ \tl_set:Ne \l_@@_tmpb_tl
+ { \tl_tail:V \l_@@_tmpb_tl }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ { \bool_set_true:N \l_@@_tmpa_bool }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l_@@_tmpb_tl
}
{ \tl_set:Nn #3 { zc at missingproperty } }
}
@@ -3532,7 +3516,6 @@
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_current_language_tl }
}
-
{ main }
{
\tl_set:Nn \l_@@_ref_language_tl
@@ -3578,7 +3561,6 @@
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_current_language_tl }
}
-
{ main }
{
\tl_set:Nn \l_@@_ref_language_tl
@@ -3794,7 +3776,7 @@
check .code:n =
{
\bool_set_true:N \l_@@_zcref_with_check_bool
- \keys_set:nn { zref-check / zcheck } {#1}
+ \keys_set:nn { zref-check/zcheck } {#1}
} ,
check .value_required:n = true ,
}
@@ -3829,8 +3811,8 @@
% 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.
+% type} option. Hence \emph{don't} make any breaking changes here without
+% previous communication.
%
% \begin{macrocode}
\tl_new:N \l_@@_reftype_override_tl
@@ -4057,7 +4039,8 @@
% and that's precisely the case inside the \pkg{amsmath}'s \env{multline}
% environment (and possibly elsewhere?). See
% \url{https://tex.stackexchange.com/a/402297} and
-% \url{https://github.com/ho-tex/zref/issues/4}.
+% \url{https://github.com/ho-tex/zref/issues/4}. Conversely, if \cs{label} is
+% gobbled, the \texttt{label} hook also won't be called.
%
% \begin{macrocode}
\AddToHookWithArguments { label }
@@ -4277,10 +4260,13 @@
% for package options (\cs{zcsetup}) we want the whole set, so we aggregate
% the two into \texttt{zref-clever/zcsetup}, and use that here.
%
+% See \url{https://github.com/latex3/latex3/issues/1254}.
+%
+% ^^A zref-clever/zcsetup
% \begin{macrocode}
-\keys_define:nn { }
+\keys_define:nn { zref-clever }
{
- zref-clever/zcsetup .inherit:n =
+ zcsetup .inherit:n =
{
zref-clever/label ,
zref-clever/reference ,
@@ -4420,7 +4406,6 @@
{ \l_@@_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ stripprefix }
{
\@@_opt_tl_set:cn
@@ -4435,7 +4420,6 @@
{ \l_@@_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ pagecomp }
{
\@@_opt_tl_set:cn
@@ -4450,7 +4434,6 @@
{ \l_@@_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ pagecomp2 }
{
\@@_opt_tl_set:cn
@@ -4465,7 +4448,6 @@
{ \l_@@_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ unset }
{
\@@_opt_tl_unset:c
@@ -4645,33 +4627,33 @@
\NewDocumentCommand \zcLanguageSetup { m m }
{
\group_begin:
- \@@_language_if_declared:nTF {#1}
- {
- \tl_clear:N \l_@@_setup_type_tl
- \tl_set:Nn \l_@@_setup_language_tl {#1}
- \@@_opt_seq_get:cNF
- {
- \@@_opt_varname_language:nnn
- {#1} { declension } { seq }
- }
- \l_@@_lang_declension_seq
- { \seq_clear:N \l_@@_lang_declension_seq }
- \seq_if_empty:NTF \l_@@_lang_declension_seq
- { \tl_clear:N \l_@@_lang_decl_case_tl }
- {
- \seq_get_left:NN \l_@@_lang_declension_seq
- \l_@@_lang_decl_case_tl
- }
- \@@_opt_seq_get:cNF
- {
- \@@_opt_varname_language:nnn
- {#1} { gender } { seq }
- }
- \l_@@_lang_gender_seq
- { \seq_clear:N \l_@@_lang_gender_seq }
- \keys_set:nn { zref-clever/langsetup } {#2}
- }
- { \msg_warning:nnn { zref-clever } { unknown-language-setup } {#1} }
+ \@@_language_if_declared:nTF {#1}
+ {
+ \tl_clear:N \l_@@_setup_type_tl
+ \tl_set:Nn \l_@@_setup_language_tl {#1}
+ \@@_opt_seq_get:cNF
+ {
+ \@@_opt_varname_language:nnn
+ {#1} { declension } { seq }
+ }
+ \l_@@_lang_declension_seq
+ { \seq_clear:N \l_@@_lang_declension_seq }
+ \seq_if_empty:NTF \l_@@_lang_declension_seq
+ { \tl_clear:N \l_@@_lang_decl_case_tl }
+ {
+ \seq_get_left:NN \l_@@_lang_declension_seq
+ \l_@@_lang_decl_case_tl
+ }
+ \@@_opt_seq_get:cNF
+ {
+ \@@_opt_varname_language:nnn
+ {#1} { gender } { seq }
+ }
+ \l_@@_lang_gender_seq
+ { \seq_clear:N \l_@@_lang_gender_seq }
+ \keys_set:nn { zref-clever/langsetup } {#2}
+ }
+ { \msg_warning:nnn { zref-clever } { unknown-language-setup } {#1} }
\group_end:
}
\@onlypreamble \zcLanguageSetup
@@ -4692,7 +4674,6 @@
{ \tl_clear:N \l_@@_setup_type_tl }
{ \tl_set:Nn \l_@@_setup_type_tl {#1} }
} ,
-
case .code:n =
{
\seq_if_empty:NTF \l_@@_lang_declension_seq
@@ -4712,7 +4693,6 @@
}
} ,
case .value_required:n = true ,
-
gender .value_required:n = true ,
gender .code:n =
{
@@ -4847,7 +4827,6 @@
}
}
}
-
{ stripprefix }
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -4884,7 +4863,6 @@
}
}
}
-
{ pagecomp }
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -4921,7 +4899,6 @@
}
}
}
-
{ pagecomp2 }
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -5265,8 +5242,8 @@
% it does not leak to the note.
% \begin{macrocode}
\group_begin:
- \l_@@_ref_typeset_font_tl
- \@@_typeset_refs:
+ \l_@@_ref_typeset_font_tl
+ \@@_typeset_refs:
\group_end:
% \end{macrocode}
% Typeset \texttt{note}.
@@ -5294,11 +5271,11 @@
% \end{macrocode}
% Integration with \pkg{mathtools}.
% \begin{macrocode}
- \bool_if:NT \l_@@_mathtools_loaded_bool
- {
- \@@_mathtools_showonlyrefs:n
- { \l_@@_zcref_labels_seq }
- }
+ \bool_if:NT \l_@@_mathtools_loaded_bool
+ {
+ \@@_mathtools_showonlyrefs:n
+ { \l_@@_zcref_labels_seq }
+ }
\group_end:
}
% \end{macrocode}
@@ -5325,9 +5302,9 @@
\NewDocumentCommand \zcpageref { s O { } m }
{
\group_begin:
- \IfBooleanT {#1}
- { \bool_set_false:N \l_@@_hyperlink_bool }
- \zcref [#2, ref = page] {#3}
+ \IfBooleanT {#1}
+ { \bool_set_false:N \l_@@_hyperlink_bool }
+ \zcref [#2, ref = page] {#3}
\group_end:
}
% \end{macrocode}
@@ -5507,7 +5484,6 @@
\l_@@_label_type_a_tl {#1} { zc at type } { zc at missingtype }
\@@_extract_default:Nnnn
\l_@@_label_type_b_tl {#2} { zc at type } { zc at missingtype }
-
\tl_if_eq:NNTF
\l_@@_label_type_a_tl
\l_@@_label_type_b_tl
@@ -5535,9 +5511,7 @@
{#1} { externaldocument } { }
\@@_extract_default:Nnnn \l_@@_label_extdoc_b_tl
{#2} { externaldocument } { }
-
\bool_set_false:N \l_@@_sort_decided_bool
-
% First we check if there's any "external document" difference (coming
% from `zref-xr') and, if so, sort based on that.
\tl_if_eq:NNF
@@ -5575,7 +5549,6 @@
}
}
}
-
\bool_until_do:Nn \l_@@_sort_decided_bool
{
\bool_if:nTF
@@ -5818,7 +5791,7 @@
% distinguish the cases in which a range actually ``skips'' a number in the
% sequence, in which case we should use a range separator, from when they are
% after all just contiguous, in which case a pair separator is called for.
-% Since, as usual, we can only know this when a arbitrary long ``streak''
+% Since, as usual, we can only know this when a arbitrarily long ``streak''
% finishes, we have to store the label which (potentially) begins a range
% (kept in \cs{l_@@_range_beg_label_tl}). \cs{l_@@_next_maybe_range_bool}
% signals when ``next'' is potentially a range with ``current'', and
@@ -6042,7 +6015,6 @@
\int_zero:N \l_@@_range_same_count_int
\bool_set_false:N \l_@@_range_beg_is_first_bool
\bool_set_false:N \l_@@_type_first_refbounds_set_bool
-
% Get type block options (not type-specific).
\@@_get_rf_opt_tl:neeN { tpairsep }
{ \l_@@_label_type_a_tl }
@@ -6056,7 +6028,6 @@
{ \l_@@_label_type_a_tl }
{ \l_@@_ref_language_tl }
\l_@@_tlastsep_tl
-
% Process label stack.
\bool_set_false:N \l_@@_typeset_last_bool
\bool_until_do:Nn \l_@@_typeset_last_bool
@@ -6072,7 +6043,6 @@
\seq_get_left:NN \l_@@_typeset_labels_seq
\l_@@_label_b_tl
}
-
\tl_if_eq:NnTF \l_@@_ref_property_tl { page }
{
\tl_set:Nn \l_@@_label_type_a_tl { page }
@@ -6086,7 +6056,6 @@
\l_@@_label_type_b_tl
\l_@@_label_b_tl { zc at type } { zc at missingtype }
}
-
% First, we establish whether the "current label" (i.e. `a') is the
% last one of its type. This can happen because the "next label"
% (i.e. `b') is of a different type (or different definition status),
@@ -6113,7 +6082,6 @@
}
}
}
-
% Handle warnings in case of reference or type undefined.
% Test: `zc-typeset01.lvt': "Typeset refs: warn ref undefined"
\zref at refused { \l_@@_label_a_tl }
@@ -6136,7 +6104,6 @@
{ \l_@@_label_a_tl }
}
}
-
% Get possibly type-specific separators, refbounds, font and other
% options, once per type.
\int_compare:nNnT { \l_@@_label_count_int } = { 0 }
@@ -6230,7 +6197,6 @@
{ \l_@@_ref_language_tl }
\l_@@_refbounds_last_re_seq
}
-
% Here we send this to a couple of auxiliary functions.
\bool_if:NTF \l_@@_last_of_type_bool
% There exists no next label of the same type as the current.
@@ -6277,7 +6243,6 @@
\l_@@_refbounds_first_sg_seq
\bool_set_true:N \l_@@_type_first_refbounds_set_bool
}
-
% The last is the second: we have a pair (if not repeated).
% Test: `zc-typeset01.lvt': "Last of type: pair"
{ 1 }
@@ -6511,7 +6476,6 @@
}
}
}
-
% Handle "range" option. The idea is simple: if the queue is not empty,
% we replace it with the end of the range (or pair). We can still
% retrieve the end of the range from `label_a' since we know to be
@@ -6589,7 +6553,6 @@
}
}
}
-
% If none of the special cases for the first of type refbounds have been
% set, do it.
\bool_if:NF \l_@@_type_first_refbounds_set_bool
@@ -6597,7 +6560,6 @@
\seq_set_eq:NN \l_@@_type_first_refbounds_seq
\l_@@_refbounds_first_seq
}
-
% Now that the type block is finished, we can add the name and the first
% ref to the queue. Also, if "typeset" option is not "both", handle it
% here as well.
@@ -6627,24 +6589,24 @@
\bool_if:NTF \l_@@_name_in_link_bool
{
\exp_not:N \group_begin:
- \exp_not:V \l_@@_namefont_tl
- \@@_hyperlink:nnn
- {
- \@@_extract_url_unexp:V
- \l_@@_type_first_label_tl
- }
- {
- \@@_extract_unexp:Vnn
- \l_@@_type_first_label_tl
- { anchor } { }
- }
- { \exp_not:V \l_@@_type_name_tl }
+ \exp_not:V \l_@@_namefont_tl
+ \@@_hyperlink:nnn
+ {
+ \@@_extract_url_unexp:V
+ \l_@@_type_first_label_tl
+ }
+ {
+ \@@_extract_unexp:Vnn
+ \l_@@_type_first_label_tl
+ { anchor } { }
+ }
+ { \exp_not:V \l_@@_type_name_tl }
\exp_not:N \group_end:
}
{
\exp_not:N \group_begin:
- \exp_not:V \l_@@_namefont_tl
- \exp_not:V \l_@@_type_name_tl
+ \exp_not:V \l_@@_namefont_tl
+ \exp_not:V \l_@@_type_name_tl
\exp_not:N \group_end:
}
}
@@ -6660,7 +6622,6 @@
}
}
}
-
% Typeset the previous type block, if there is one.
\int_compare:nNnT { \l_@@_type_count_int } > { 0 }
{
@@ -6668,11 +6629,9 @@
{ \l_@@_tlistsep_tl }
\l_@@_typeset_queue_prev_tl
}
-
% Extra log for testing.
\bool_if:NT \l_@@_verbose_testing_bool
{ \tl_show:N \l_@@_typeset_queue_curr_tl }
-
% Wrap up loop, or prepare for next iteration.
\bool_if:NTF \l_@@_typeset_last_bool
{
@@ -6746,7 +6705,6 @@
{ \l_@@_label_a_tl } { \l_@@_label_b_tl }
}
}
-
% Process the current label to the current queue.
\int_compare:nNnTF { \l_@@_label_count_int } = { 0 }
{
@@ -6757,7 +6715,6 @@
\tl_set:NV \l_@@_type_first_label_type_tl
\l_@@_label_type_a_tl
\int_incr:N \l_@@_ref_count_int
-
% If the next label may be part of a range, signal it (we deal with it
% as the "first", and must do it there, to handle hyperlinking), but
% also step the range counters.
@@ -6998,7 +6955,7 @@
% current label, the label properties among them, but not only. Hence, these
% variables \emph{must} be expanded to their current values to be stored in
% the queue. Indeed, \cs{@@_get_ref:nN} and \cs{@@_get_ref_first:} get
-% called, as they must, in the context of \texttt{x} type expansions. But we
+% called, as they must, in the context of \texttt{e} type expansions. But we
% don't want to expand the values of the variables themselves, so we need to
% get current values, but stop expansion after that. In particular, reference
% options given by the user should reach the stream for its final typesetting
@@ -7051,9 +7008,9 @@
{
\seq_item:Nn #2 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l_@@_reffont_tl
- \@@_extract_unexp:nvn {#1}
- { l_@@_ref_property_tl } { }
+ \exp_not:V \l_@@_reffont_tl
+ \@@_extract_unexp:nvn {#1}
+ { l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn #2 { 3 }
}
@@ -7063,9 +7020,9 @@
\seq_item:Nn #2 { 1 }
\seq_item:Nn #2 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l_@@_reffont_tl
- \@@_extract_unexp:nvn {#1}
- { l_@@_ref_property_tl } { }
+ \exp_not:V \l_@@_reffont_tl
+ \@@_extract_unexp:nvn {#1}
+ { l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn #2 { 3 }
\seq_item:Nn #2 { 4 }
@@ -7100,8 +7057,8 @@
{
\seq_item:Nn #3 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l_@@_reffont_tl
- \exp_not:n {#2}
+ \exp_not:V \l_@@_reffont_tl
+ \exp_not:n {#2}
\exp_not:N \group_end:
\seq_item:Nn #3 { 3 }
}
@@ -7111,8 +7068,8 @@
\seq_item:Nn #3 { 1 }
\seq_item:Nn #3 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l_@@_reffont_tl
- \exp_not:n {#2}
+ \exp_not:V \l_@@_reffont_tl
+ \exp_not:n {#2}
\exp_not:N \group_end:
\seq_item:Nn #3 { 3 }
\seq_item:Nn #3 { 4 }
@@ -7156,17 +7113,17 @@
}
{
\exp_not:N \group_begin:
- \exp_not:V \l_@@_namefont_tl
- \exp_not:V \l_@@_type_name_tl
+ \exp_not:V \l_@@_namefont_tl
+ \exp_not:V \l_@@_type_name_tl
\exp_not:N \group_end:
\exp_not:V \l_@@_namesep_tl
\seq_item:Nn \l_@@_type_first_refbounds_seq { 1 }
\seq_item:Nn \l_@@_type_first_refbounds_seq { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l_@@_reffont_tl
- \@@_extract_unexp:Vvn
- \l_@@_type_first_label_tl
- { l_@@_ref_property_tl } { }
+ \exp_not:V \l_@@_reffont_tl
+ \@@_extract_unexp:Vvn
+ \l_@@_type_first_label_tl
+ { l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn \l_@@_type_first_refbounds_seq { 3 }
}
@@ -7174,8 +7131,8 @@
}
{
\exp_not:N \group_begin:
- \exp_not:V \l_@@_namefont_tl
- \exp_not:V \l_@@_type_name_tl
+ \exp_not:V \l_@@_namefont_tl
+ \exp_not:V \l_@@_type_name_tl
\exp_not:N \group_end:
\exp_not:V \l_@@_namesep_tl
\@@_ref_default:
@@ -7189,8 +7146,8 @@
}
{
\exp_not:N \group_begin:
- \exp_not:V \l_@@_namefont_tl
- \exp_not:V \l_@@_type_name_tl
+ \exp_not:V \l_@@_namefont_tl
+ \exp_not:V \l_@@_type_name_tl
\exp_not:N \group_end:
\tl_if_empty:NF \l_@@_type_name_tl
{ \exp_not:V \l_@@_namesep_tl }
@@ -7220,10 +7177,10 @@
\seq_item:Nn
\l_@@_type_first_refbounds_seq { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l_@@_reffont_tl
- \@@_extract_unexp:Vvn
- \l_@@_type_first_label_tl
- { l_@@_ref_property_tl } { }
+ \exp_not:V \l_@@_reffont_tl
+ \@@_extract_unexp:Vvn
+ \l_@@_type_first_label_tl
+ { l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn
\l_@@_type_first_refbounds_seq { 3 }
@@ -7235,10 +7192,10 @@
\seq_item:Nn \l_@@_type_first_refbounds_seq { 1 }
\seq_item:Nn \l_@@_type_first_refbounds_seq { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l_@@_reffont_tl
- \@@_extract_unexp:Vvn
- \l_@@_type_first_label_tl
- { l_@@_ref_property_tl } { }
+ \exp_not:V \l_@@_reffont_tl
+ \@@_extract_unexp:Vvn
+ \l_@@_type_first_label_tl
+ { l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn \l_@@_type_first_refbounds_seq { 3 }
\seq_item:Nn \l_@@_type_first_refbounds_seq { 4 }
@@ -7320,7 +7277,6 @@
\tl_put_right:Nn \l_@@_name_format_tl { -ab }
}
{ \tl_clear:N \l_@@_name_format_fallback_tl }
-
% Handle number and gender nudges.
% Note that these nudges get disabled for `typeset=ref' /
% `noname' option, but in this case they are not really
@@ -7386,7 +7342,6 @@
}
}
}
-
\tl_if_empty:NTF \l_@@_name_format_fallback_tl
{
\@@_opt_tl_get:cNF
@@ -7487,7 +7442,6 @@
}
}
}
-
% Signal whether the type name is to be included in the hyperlink or
% not.
\bool_lazy_any:nTF
@@ -7544,7 +7498,7 @@
% \begin{macro}{\@@_extract_url_unexp:n}
% A convenience auxiliary function for extraction of the \texttt{url} /
% \texttt{urluse} property, provided by the \pkg{zref-xr} module. Ensure
-% that, in the context of an x expansion, \cs{zref at extractdefault} is
+% that, in the context of an e expansion, \cs{zref at extractdefault} is
% expanded exactly twice, but no further to retrieve the proper value. See
% documentation for \cs{@@_extract_unexp:nnn}.
% \begin{macrocode}
@@ -7590,13 +7544,13 @@
{
\int_compare:nNnTF
{ \@@_extract:nnn {#1} { zc at pgval } { -2 } + 1 }
- =
+ =
{ \@@_extract:nnn {#2} { zc at pgval } { -1 } }
{ \bool_set_true:N \l_@@_next_maybe_range_bool }
{
\int_compare:nNnT
{ \@@_extract:nnn {#1} { zc at pgval } { -1 } }
- =
+ =
{ \@@_extract:nnn {#2} { zc at pgval } { -1 } }
{
\bool_set_true:N \l_@@_next_maybe_range_bool
@@ -7616,13 +7570,13 @@
{
\int_compare:nNnTF
{ \@@_extract:nnn {#1} { zc at cntval } { -2 } + 1 }
- =
+ =
{ \@@_extract:nnn {#2} { zc at cntval } { -1 } }
{ \bool_set_true:N \l_@@_next_maybe_range_bool }
{
\int_compare:nNnT
{ \@@_extract:nnn {#1} { zc at cntval } { -1 } }
- =
+ =
{ \@@_extract:nnn {#2} { zc at cntval } { -1 } }
{
% \end{macrocode}
@@ -11814,4 +11768,9 @@
%
% \PrintIndex
%
+% \endinput
%
+%
+% Local Variables:
+% TeX-engine: luatex
+% End:
Modified: trunk/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty 2024-11-08 22:05:35 UTC (rev 72797)
+++ trunk/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty 2024-11-08 22:05:45 UTC (rev 72798)
@@ -52,7 +52,7 @@
'zref-clever' requires a LaTeX kernel \zrefclever at required@kernel\space or newer.%
}%
}%
-\ProvidesExplPackage {zref-clever} {2024-09-30} {0.4.7}
+\ProvidesExplPackage {zref-clever} {2024-11-07} {0.4.8}
{Clever LaTeX cross-references based on zref}
\RequirePackage { zref-base }
\RequirePackage { zref-user }
@@ -151,7 +151,7 @@
\zref at newprop { zc at enclval }
{
\__zrefclever_get_enclosing_counters_value:e
- \l__zrefclever_current_counter_tl
+ { \l__zrefclever_current_counter_tl }
}
\zref at addprop \ZREF at mainlist { zc at enclval }
\zref at newprop { zc at enclcnt }
@@ -783,8 +783,8 @@
\prg_new_conditional:Npnn \__zrefclever_language_if_declared:n #1 { T , F , TF }
{
\tl_if_exist:cTF { \__zrefclever_language_varname:n {#1} }
- { \prg_return_true: }
- { \prg_return_false: }
+ { \prg_return_true: }
+ { \prg_return_false: }
}
\prg_generate_conditional_variant:Nnn
\__zrefclever_language_if_declared:n { e } { T , F , TF }
@@ -793,17 +793,17 @@
\NewDocumentCommand \zcDeclareLanguage { O { } m }
{
\group_begin:
- \tl_if_empty:nF {#2}
- {
- \__zrefclever_language_if_declared:nTF {#2}
- { \msg_warning:nnn { zref-clever } { language-declared } {#2} }
- {
- \tl_new:c { \__zrefclever_language_varname:n {#2} }
- \tl_gset:cn { \__zrefclever_language_varname:n {#2} } {#2}
- \tl_set:Nn \l__zrefclever_setup_language_tl {#2}
- \keys_set:nn { zref-clever/declarelang } {#1}
- }
- }
+ \tl_if_empty:nF {#2}
+ {
+ \__zrefclever_language_if_declared:nTF {#2}
+ { \msg_warning:nnn { zref-clever } { language-declared } {#2} }
+ {
+ \tl_new:c { \__zrefclever_language_varname:n {#2} }
+ \tl_gset:cn { \__zrefclever_language_varname:n {#2} } {#2}
+ \tl_set:Nn \l__zrefclever_setup_language_tl {#2}
+ \keys_set:nn { zref-clever/declarelang } {#1}
+ }
+ }
\group_end:
}
\@onlypreamble \zcDeclareLanguage
@@ -974,57 +974,57 @@
\cs_new_protected:Npn \__zrefclever_provide_langfile:n #1
{
\group_begin:
- \@bsphack
- \__zrefclever_language_if_declared:nT {#1}
- {
- \seq_if_in:NeF
- \g__zrefclever_loaded_langfiles_seq
- { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
- {
- \exp_args:Ne \file_get:nnNTF
- {
- zref-clever-
- \tl_use:c { \__zrefclever_language_varname:n {#1} }
- .lang
- }
- { \ExplSyntaxOn }
- \l__zrefclever_tmpa_tl
- {
- \tl_set:Nn \l__zrefclever_setup_language_tl {#1}
- \tl_clear:N \l__zrefclever_setup_type_tl
- \__zrefclever_opt_seq_get:cNF
- {
- \__zrefclever_opt_varname_language:nnn
- {#1} { declension } { seq }
- }
- \l__zrefclever_lang_declension_seq
- { \seq_clear:N \l__zrefclever_lang_declension_seq }
- \seq_if_empty:NTF \l__zrefclever_lang_declension_seq
- { \tl_clear:N \l__zrefclever_lang_decl_case_tl }
- {
- \seq_get_left:NN \l__zrefclever_lang_declension_seq
- \l__zrefclever_lang_decl_case_tl
- }
- \__zrefclever_opt_seq_get:cNF
- {
- \__zrefclever_opt_varname_language:nnn
- {#1} { gender } { seq }
- }
- \l__zrefclever_lang_gender_seq
- { \seq_clear:N \l__zrefclever_lang_gender_seq }
- \keys_set:nV { zref-clever/langfile } \l__zrefclever_tmpa_tl
- \seq_gput_right:Ne \g__zrefclever_loaded_langfiles_seq
- { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
- \msg_info:nne { zref-clever } { langfile-loaded }
- { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
- }
- {
- \seq_gput_right:Ne \g__zrefclever_loaded_langfiles_seq
- { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
- }
- }
- }
- \@esphack
+ \@bsphack
+ \__zrefclever_language_if_declared:nT {#1}
+ {
+ \seq_if_in:NeF
+ \g__zrefclever_loaded_langfiles_seq
+ { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
+ {
+ \exp_args:Ne \file_get:nnNTF
+ {
+ zref-clever-
+ \tl_use:c { \__zrefclever_language_varname:n {#1} }
+ .lang
+ }
+ { \ExplSyntaxOn }
+ \l__zrefclever_tmpa_tl
+ {
+ \tl_set:Nn \l__zrefclever_setup_language_tl {#1}
+ \tl_clear:N \l__zrefclever_setup_type_tl
+ \__zrefclever_opt_seq_get:cNF
+ {
+ \__zrefclever_opt_varname_language:nnn
+ {#1} { declension } { seq }
+ }
+ \l__zrefclever_lang_declension_seq
+ { \seq_clear:N \l__zrefclever_lang_declension_seq }
+ \seq_if_empty:NTF \l__zrefclever_lang_declension_seq
+ { \tl_clear:N \l__zrefclever_lang_decl_case_tl }
+ {
+ \seq_get_left:NN \l__zrefclever_lang_declension_seq
+ \l__zrefclever_lang_decl_case_tl
+ }
+ \__zrefclever_opt_seq_get:cNF
+ {
+ \__zrefclever_opt_varname_language:nnn
+ {#1} { gender } { seq }
+ }
+ \l__zrefclever_lang_gender_seq
+ { \seq_clear:N \l__zrefclever_lang_gender_seq }
+ \keys_set:nV { zref-clever/langfile } \l__zrefclever_tmpa_tl
+ \seq_gput_right:Ne \g__zrefclever_loaded_langfiles_seq
+ { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
+ \msg_info:nne { zref-clever } { langfile-loaded }
+ { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
+ }
+ {
+ \seq_gput_right:Ne \g__zrefclever_loaded_langfiles_seq
+ { \tl_use:c { \__zrefclever_language_varname:n {#1} } }
+ }
+ }
+ }
+ \@esphack
\group_end:
}
\cs_generate_variant:Nn \__zrefclever_provide_langfile:n { e }
@@ -1036,7 +1036,6 @@
{ \tl_clear:N \l__zrefclever_setup_type_tl }
{ \tl_set:Nn \l__zrefclever_setup_type_tl {#1} }
} ,
-
case .code:n =
{
\seq_if_empty:NTF \l__zrefclever_lang_declension_seq
@@ -1056,7 +1055,6 @@
}
} ,
case .value_required:n = true ,
-
gender .value_required:n = true ,
gender .code:n =
{
@@ -1211,7 +1209,6 @@
}
}
}
-
{ stripprefix }
{
\tl_if_empty:NTF \l__zrefclever_setup_type_tl
@@ -1248,7 +1245,6 @@
}
}
}
-
{ pagecomp }
{
\tl_if_empty:NTF \l__zrefclever_setup_type_tl
@@ -1285,7 +1281,6 @@
}
}
}
-
{ pagecomp2 }
{
\tl_if_empty:NTF \l__zrefclever_setup_type_tl
@@ -1653,7 +1648,6 @@
} ,
typeset .initial:n = both ,
typeset .value_required:n = true ,
-
noname .meta:n = { typeset = ref } ,
noname .value_forbidden:n = true ,
noref .meta:n = { typeset = name } ,
@@ -1712,7 +1706,6 @@
{ endrangeprop } { tl }
}
}
-
{ stripprefix }
{
\__zrefclever_opt_tl_set:cn
@@ -1727,7 +1720,6 @@
{ endrangeprop } { tl }
}
}
-
{ pagecomp }
{
\__zrefclever_opt_tl_set:cn
@@ -1742,7 +1734,6 @@
{ endrangeprop } { tl }
}
}
-
{ pagecomp2 }
{
\__zrefclever_opt_tl_set:cn
@@ -1757,7 +1748,6 @@
{ endrangeprop } { tl }
}
}
-
{ unset }
{
\__zrefclever_opt_tl_unset:c
@@ -1820,71 +1810,71 @@
\bool_if:NTF \l__zrefclever_typeset_range_bool
{
\group_begin:
- \bool_set_false:N \l__zrefclever_tmpa_bool
- \exp_args:Nee \tl_if_eq:nnT
- {
- \__zrefclever_extract_unexp:nnn
- {#1} { externaldocument } { }
- }
- {
- \__zrefclever_extract_unexp:nnn
- {#2} { externaldocument } { }
- }
- {
- \tl_if_eq:NnTF \l__zrefclever_ref_property_tl { page }
- {
- \exp_args:Nee \tl_if_eq:nnT
- {
- \__zrefclever_extract_unexp:nnn
- {#1} { zc at pgfmt } { }
- }
- {
- \__zrefclever_extract_unexp:nnn
- {#2} { zc at pgfmt } { }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- {
- \exp_args:Nee \tl_if_eq:nnT
- {
- \__zrefclever_extract_unexp:nnn
- {#1} { zc at counter } { }
- }
- {
- \__zrefclever_extract_unexp:nnn
- {#2} { zc at counter } { }
- }
- {
- \exp_args:Nee \tl_if_eq:nnT
- {
- \__zrefclever_extract_unexp:nnn
- {#1} { zc at enclval } { }
- }
- {
- \__zrefclever_extract_unexp:nnn
- {#2} { zc at enclval } { }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- }
- }
- \bool_if:NTF \l__zrefclever_tmpa_bool
- {
- \__zrefclever_extract_default:Nnvn \l__zrefclever_tmpb_tl
- {#2} { l__zrefclever_endrangeprop_tl } { }
- }
- {
- \zref at ifrefcontainsprop
- {#2} { \l__zrefclever_ref_property_tl }
- {
- \__zrefclever_extract_default:Nnvn \l__zrefclever_tmpb_tl
- {#2} { l__zrefclever_ref_property_tl } { }
- }
- { \tl_set:Nn \l__zrefclever_tmpb_tl { zc at missingproperty } }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l__zrefclever_tmpb_tl
+ \bool_set_false:N \l__zrefclever_tmpa_bool
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#1} { externaldocument } { }
+ }
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#2} { externaldocument } { }
+ }
+ {
+ \tl_if_eq:NnTF \l__zrefclever_ref_property_tl { page }
+ {
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#1} { zc at pgfmt } { }
+ }
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#2} { zc at pgfmt } { }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ {
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#1} { zc at counter } { }
+ }
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#2} { zc at counter } { }
+ }
+ {
+ \exp_args:Nee \tl_if_eq:nnT
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#1} { zc at enclval } { }
+ }
+ {
+ \__zrefclever_extract_unexp:nnn
+ {#2} { zc at enclval } { }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ }
+ }
+ \bool_if:NTF \l__zrefclever_tmpa_bool
+ {
+ \__zrefclever_extract_default:Nnvn \l__zrefclever_tmpb_tl
+ {#2} { l__zrefclever_endrangeprop_tl } { }
+ }
+ {
+ \zref at ifrefcontainsprop
+ {#2} { \l__zrefclever_ref_property_tl }
+ {
+ \__zrefclever_extract_default:Nnvn \l__zrefclever_tmpb_tl
+ {#2} { l__zrefclever_ref_property_tl } { }
+ }
+ { \tl_set:Nn \l__zrefclever_tmpb_tl { zc at missingproperty } }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l__zrefclever_tmpb_tl
}
{
\__zrefclever_extract_default:Nnvn #3
@@ -1907,36 +1897,36 @@
\zref at ifrefcontainsprop {#2} { \l__zrefclever_ref_property_tl }
{
\group_begin:
- \UseHook { zref-clever/endrange-setup }
- \tl_set:Ne \l__zrefclever_tmpa_tl
- {
- \__zrefclever_extract:nnn
- {#1} { \l__zrefclever_ref_property_tl } { }
- }
- \tl_set:Ne \l__zrefclever_tmpb_tl
- {
- \__zrefclever_extract:nnn
- {#2} { \l__zrefclever_ref_property_tl } { }
- }
- \bool_set_false:N \l__zrefclever_tmpa_bool
- \bool_until_do:Nn \l__zrefclever_tmpa_bool
- {
- \exp_args:Nee \tl_if_eq:nnTF
- { \tl_head:V \l__zrefclever_tmpa_tl }
- { \tl_head:V \l__zrefclever_tmpb_tl }
- {
- \tl_set:Ne \l__zrefclever_tmpa_tl
- { \tl_tail:V \l__zrefclever_tmpa_tl }
- \tl_set:Ne \l__zrefclever_tmpb_tl
- { \tl_tail:V \l__zrefclever_tmpb_tl }
- \tl_if_empty:NT \l__zrefclever_tmpb_tl
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l__zrefclever_tmpb_tl
+ \UseHook { zref-clever/endrange-setup }
+ \tl_set:Ne \l__zrefclever_tmpa_tl
+ {
+ \__zrefclever_extract:nnn
+ {#1} { \l__zrefclever_ref_property_tl } { }
+ }
+ \tl_set:Ne \l__zrefclever_tmpb_tl
+ {
+ \__zrefclever_extract:nnn
+ {#2} { \l__zrefclever_ref_property_tl } { }
+ }
+ \bool_set_false:N \l__zrefclever_tmpa_bool
+ \bool_until_do:Nn \l__zrefclever_tmpa_bool
+ {
+ \exp_args:Nee \tl_if_eq:nnTF
+ { \tl_head:V \l__zrefclever_tmpa_tl }
+ { \tl_head:V \l__zrefclever_tmpb_tl }
+ {
+ \tl_set:Ne \l__zrefclever_tmpa_tl
+ { \tl_tail:V \l__zrefclever_tmpa_tl }
+ \tl_set:Ne \l__zrefclever_tmpb_tl
+ { \tl_tail:V \l__zrefclever_tmpb_tl }
+ \tl_if_empty:NT \l__zrefclever_tmpb_tl
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l__zrefclever_tmpb_tl
}
{ \tl_set:Nn #3 { zc at missingproperty } }
}
@@ -1955,42 +1945,42 @@
\zref at ifrefcontainsprop {#2} { \l__zrefclever_ref_property_tl }
{
\group_begin:
- \UseHook { zref-clever/endrange-setup }
- \tl_set:Ne \l__zrefclever_tmpa_tl
- {
- \__zrefclever_extract:nnn
- {#1} { \l__zrefclever_ref_property_tl } { }
- }
- \tl_set:Ne \l__zrefclever_tmpb_tl
- {
- \__zrefclever_extract:nnn
- {#2} { \l__zrefclever_ref_property_tl } { }
- }
- \bool_set_false:N \l__zrefclever_tmpa_bool
- \__zrefclever_is_integer_rgx:VTF \l__zrefclever_tmpa_tl
- {
- \__zrefclever_is_integer_rgx:VF \l__zrefclever_tmpb_tl
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- \bool_until_do:Nn \l__zrefclever_tmpa_bool
- {
- \exp_args:Nee \tl_if_eq:nnTF
- { \tl_head:V \l__zrefclever_tmpa_tl }
- { \tl_head:V \l__zrefclever_tmpb_tl }
- {
- \tl_set:Ne \l__zrefclever_tmpa_tl
- { \tl_tail:V \l__zrefclever_tmpa_tl }
- \tl_set:Ne \l__zrefclever_tmpb_tl
- { \tl_tail:V \l__zrefclever_tmpb_tl }
- \tl_if_empty:NT \l__zrefclever_tmpb_tl
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l__zrefclever_tmpb_tl
+ \UseHook { zref-clever/endrange-setup }
+ \tl_set:Ne \l__zrefclever_tmpa_tl
+ {
+ \__zrefclever_extract:nnn
+ {#1} { \l__zrefclever_ref_property_tl } { }
+ }
+ \tl_set:Ne \l__zrefclever_tmpb_tl
+ {
+ \__zrefclever_extract:nnn
+ {#2} { \l__zrefclever_ref_property_tl } { }
+ }
+ \bool_set_false:N \l__zrefclever_tmpa_bool
+ \__zrefclever_is_integer_rgx:VTF \l__zrefclever_tmpa_tl
+ {
+ \__zrefclever_is_integer_rgx:VF \l__zrefclever_tmpb_tl
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ \bool_until_do:Nn \l__zrefclever_tmpa_bool
+ {
+ \exp_args:Nee \tl_if_eq:nnTF
+ { \tl_head:V \l__zrefclever_tmpa_tl }
+ { \tl_head:V \l__zrefclever_tmpb_tl }
+ {
+ \tl_set:Ne \l__zrefclever_tmpa_tl
+ { \tl_tail:V \l__zrefclever_tmpa_tl }
+ \tl_set:Ne \l__zrefclever_tmpb_tl
+ { \tl_tail:V \l__zrefclever_tmpb_tl }
+ \tl_if_empty:NT \l__zrefclever_tmpb_tl
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l__zrefclever_tmpb_tl
}
{ \tl_set:Nn #3 { zc at missingproperty } }
}
@@ -2000,49 +1990,49 @@
\zref at ifrefcontainsprop {#2} { \l__zrefclever_ref_property_tl }
{
\group_begin:
- \UseHook { zref-clever/endrange-setup }
- \tl_set:Ne \l__zrefclever_tmpa_tl
- {
- \__zrefclever_extract:nnn
- {#1} { \l__zrefclever_ref_property_tl } { }
- }
- \tl_set:Ne \l__zrefclever_tmpb_tl
- {
- \__zrefclever_extract:nnn
- {#2} { \l__zrefclever_ref_property_tl } { }
- }
- \bool_set_false:N \l__zrefclever_tmpa_bool
- \__zrefclever_is_integer_rgx:VTF \l__zrefclever_tmpa_tl
- {
- \__zrefclever_is_integer_rgx:VF \l__zrefclever_tmpb_tl
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- \bool_until_do:Nn \l__zrefclever_tmpa_bool
- {
- \exp_args:Nee \tl_if_eq:nnTF
- { \tl_head:V \l__zrefclever_tmpa_tl }
- { \tl_head:V \l__zrefclever_tmpb_tl }
- {
- \bool_lazy_or:nnTF
- { \int_compare_p:nNn { \l__zrefclever_tmpb_tl } > { 99 } }
- {
- \int_compare_p:nNn
- { \tl_head:V \l__zrefclever_tmpb_tl } = { 0 }
- }
- {
- \tl_set:Ne \l__zrefclever_tmpa_tl
- { \tl_tail:V \l__zrefclever_tmpa_tl }
- \tl_set:Ne \l__zrefclever_tmpb_tl
- { \tl_tail:V \l__zrefclever_tmpb_tl }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- { \bool_set_true:N \l__zrefclever_tmpa_bool }
- }
- \exp_args:NNNV
- \group_end:
- \tl_set:Nn #3 \l__zrefclever_tmpb_tl
+ \UseHook { zref-clever/endrange-setup }
+ \tl_set:Ne \l__zrefclever_tmpa_tl
+ {
+ \__zrefclever_extract:nnn
+ {#1} { \l__zrefclever_ref_property_tl } { }
+ }
+ \tl_set:Ne \l__zrefclever_tmpb_tl
+ {
+ \__zrefclever_extract:nnn
+ {#2} { \l__zrefclever_ref_property_tl } { }
+ }
+ \bool_set_false:N \l__zrefclever_tmpa_bool
+ \__zrefclever_is_integer_rgx:VTF \l__zrefclever_tmpa_tl
+ {
+ \__zrefclever_is_integer_rgx:VF \l__zrefclever_tmpb_tl
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ \bool_until_do:Nn \l__zrefclever_tmpa_bool
+ {
+ \exp_args:Nee \tl_if_eq:nnTF
+ { \tl_head:V \l__zrefclever_tmpa_tl }
+ { \tl_head:V \l__zrefclever_tmpb_tl }
+ {
+ \bool_lazy_or:nnTF
+ { \int_compare_p:nNn { \l__zrefclever_tmpb_tl } > { 99 } }
+ {
+ \int_compare_p:nNn
+ { \tl_head:V \l__zrefclever_tmpb_tl } = { 0 }
+ }
+ {
+ \tl_set:Ne \l__zrefclever_tmpa_tl
+ { \tl_tail:V \l__zrefclever_tmpa_tl }
+ \tl_set:Ne \l__zrefclever_tmpb_tl
+ { \tl_tail:V \l__zrefclever_tmpb_tl }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ { \bool_set_true:N \l__zrefclever_tmpa_bool }
+ }
+ \exp_args:NNNV
+ \group_end:
+ \tl_set:Nn #3 \l__zrefclever_tmpb_tl
}
{ \tl_set:Nn #3 { zc at missingproperty } }
}
@@ -2175,7 +2165,6 @@
\tl_set:Nn \l__zrefclever_ref_language_tl
{ \l__zrefclever_current_language_tl }
}
-
{ main }
{
\tl_set:Nn \l__zrefclever_ref_language_tl
@@ -2212,7 +2201,6 @@
\tl_set:Nn \l__zrefclever_ref_language_tl
{ \l__zrefclever_current_language_tl }
}
-
{ main }
{
\tl_set:Nn \l__zrefclever_ref_language_tl
@@ -2364,7 +2352,7 @@
check .code:n =
{
\bool_set_true:N \l__zrefclever_zcref_with_check_bool
- \keys_set:nn { zref-check / zcheck } {#1}
+ \keys_set:nn { zref-check/zcheck } {#1}
} ,
check .value_required:n = true ,
}
@@ -2645,9 +2633,9 @@
no #1 .value_forbidden:n = true ,
}
}
-\keys_define:nn { }
+\keys_define:nn { zref-clever }
{
- zref-clever/zcsetup .inherit:n =
+ zcsetup .inherit:n =
{
zref-clever/label ,
zref-clever/reference ,
@@ -2726,7 +2714,6 @@
{ \l__zrefclever_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ stripprefix }
{
\__zrefclever_opt_tl_set:cn
@@ -2741,7 +2728,6 @@
{ \l__zrefclever_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ pagecomp }
{
\__zrefclever_opt_tl_set:cn
@@ -2756,7 +2742,6 @@
{ \l__zrefclever_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ pagecomp2 }
{
\__zrefclever_opt_tl_set:cn
@@ -2771,7 +2756,6 @@
{ \l__zrefclever_setup_type_tl } { endrangeprop } { tl }
}
}
-
{ unset }
{
\__zrefclever_opt_tl_unset:c
@@ -2930,33 +2914,33 @@
\NewDocumentCommand \zcLanguageSetup { m m }
{
\group_begin:
- \__zrefclever_language_if_declared:nTF {#1}
- {
- \tl_clear:N \l__zrefclever_setup_type_tl
- \tl_set:Nn \l__zrefclever_setup_language_tl {#1}
- \__zrefclever_opt_seq_get:cNF
- {
- \__zrefclever_opt_varname_language:nnn
- {#1} { declension } { seq }
- }
- \l__zrefclever_lang_declension_seq
- { \seq_clear:N \l__zrefclever_lang_declension_seq }
- \seq_if_empty:NTF \l__zrefclever_lang_declension_seq
- { \tl_clear:N \l__zrefclever_lang_decl_case_tl }
- {
- \seq_get_left:NN \l__zrefclever_lang_declension_seq
- \l__zrefclever_lang_decl_case_tl
- }
- \__zrefclever_opt_seq_get:cNF
- {
- \__zrefclever_opt_varname_language:nnn
- {#1} { gender } { seq }
- }
- \l__zrefclever_lang_gender_seq
- { \seq_clear:N \l__zrefclever_lang_gender_seq }
- \keys_set:nn { zref-clever/langsetup } {#2}
- }
- { \msg_warning:nnn { zref-clever } { unknown-language-setup } {#1} }
+ \__zrefclever_language_if_declared:nTF {#1}
+ {
+ \tl_clear:N \l__zrefclever_setup_type_tl
+ \tl_set:Nn \l__zrefclever_setup_language_tl {#1}
+ \__zrefclever_opt_seq_get:cNF
+ {
+ \__zrefclever_opt_varname_language:nnn
+ {#1} { declension } { seq }
+ }
+ \l__zrefclever_lang_declension_seq
+ { \seq_clear:N \l__zrefclever_lang_declension_seq }
+ \seq_if_empty:NTF \l__zrefclever_lang_declension_seq
+ { \tl_clear:N \l__zrefclever_lang_decl_case_tl }
+ {
+ \seq_get_left:NN \l__zrefclever_lang_declension_seq
+ \l__zrefclever_lang_decl_case_tl
+ }
+ \__zrefclever_opt_seq_get:cNF
+ {
+ \__zrefclever_opt_varname_language:nnn
+ {#1} { gender } { seq }
+ }
+ \l__zrefclever_lang_gender_seq
+ { \seq_clear:N \l__zrefclever_lang_gender_seq }
+ \keys_set:nn { zref-clever/langsetup } {#2}
+ }
+ { \msg_warning:nnn { zref-clever } { unknown-language-setup } {#1} }
\group_end:
}
\@onlypreamble \zcLanguageSetup
@@ -2968,7 +2952,6 @@
{ \tl_clear:N \l__zrefclever_setup_type_tl }
{ \tl_set:Nn \l__zrefclever_setup_type_tl {#1} }
} ,
-
case .code:n =
{
\seq_if_empty:NTF \l__zrefclever_lang_declension_seq
@@ -2988,7 +2971,6 @@
}
} ,
case .value_required:n = true ,
-
gender .value_required:n = true ,
gender .code:n =
{
@@ -3123,7 +3105,6 @@
}
}
}
-
{ stripprefix }
{
\tl_if_empty:NTF \l__zrefclever_setup_type_tl
@@ -3160,7 +3141,6 @@
}
}
}
-
{ pagecomp }
{
\tl_if_empty:NTF \l__zrefclever_setup_type_tl
@@ -3197,7 +3177,6 @@
}
}
}
-
{ pagecomp2 }
{
\tl_if_empty:NTF \l__zrefclever_setup_type_tl
@@ -3489,8 +3468,8 @@
{ \l__zrefclever_typeset_range_bool }
{ \__zrefclever_sort_labels: }
\group_begin:
- \l__zrefclever_ref_typeset_font_tl
- \__zrefclever_typeset_refs:
+ \l__zrefclever_ref_typeset_font_tl
+ \__zrefclever_typeset_refs:
\group_end:
\tl_if_empty:NF \l__zrefclever_zcref_note_tl
{
@@ -3509,11 +3488,11 @@
\zrefcheck_zcref_run_checks_on_labels:n
{ \l__zrefclever_zcref_labels_seq }
}
- \bool_if:NT \l__zrefclever_mathtools_loaded_bool
- {
- \__zrefclever_mathtools_showonlyrefs:n
- { \l__zrefclever_zcref_labels_seq }
- }
+ \bool_if:NT \l__zrefclever_mathtools_loaded_bool
+ {
+ \__zrefclever_mathtools_showonlyrefs:n
+ { \l__zrefclever_zcref_labels_seq }
+ }
\group_end:
}
\seq_new:N \l__zrefclever_zcref_labels_seq
@@ -3521,9 +3500,9 @@
\NewDocumentCommand \zcpageref { s O { } m }
{
\group_begin:
- \IfBooleanT {#1}
- { \bool_set_false:N \l__zrefclever_hyperlink_bool }
- \zcref [#2, ref = page] {#3}
+ \IfBooleanT {#1}
+ { \bool_set_false:N \l__zrefclever_hyperlink_bool }
+ \zcref [#2, ref = page] {#3}
\group_end:
}
\tl_new:N \l__zrefclever_label_type_a_tl
@@ -3595,7 +3574,6 @@
\l__zrefclever_label_type_a_tl {#1} { zc at type } { zc at missingtype }
\__zrefclever_extract_default:Nnnn
\l__zrefclever_label_type_b_tl {#2} { zc at type } { zc at missingtype }
-
\tl_if_eq:NNTF
\l__zrefclever_label_type_a_tl
\l__zrefclever_label_type_b_tl
@@ -3614,9 +3592,7 @@
{#1} { externaldocument } { }
\__zrefclever_extract_default:Nnnn \l__zrefclever_label_extdoc_b_tl
{#2} { externaldocument } { }
-
\bool_set_false:N \l__zrefclever_sort_decided_bool
-
% First we check if there's any "external document" difference (coming
% from `zref-xr') and, if so, sort based on that.
\tl_if_eq:NNF
@@ -3654,7 +3630,6 @@
}
}
}
-
\bool_until_do:Nn \l__zrefclever_sort_decided_bool
{
\bool_if:nTF
@@ -3863,7 +3838,6 @@
\int_zero:N \l__zrefclever_range_same_count_int
\bool_set_false:N \l__zrefclever_range_beg_is_first_bool
\bool_set_false:N \l__zrefclever_type_first_refbounds_set_bool
-
% Get type block options (not type-specific).
\__zrefclever_get_rf_opt_tl:neeN { tpairsep }
{ \l__zrefclever_label_type_a_tl }
@@ -3877,7 +3851,6 @@
{ \l__zrefclever_label_type_a_tl }
{ \l__zrefclever_ref_language_tl }
\l__zrefclever_tlastsep_tl
-
% Process label stack.
\bool_set_false:N \l__zrefclever_typeset_last_bool
\bool_until_do:Nn \l__zrefclever_typeset_last_bool
@@ -3893,7 +3866,6 @@
\seq_get_left:NN \l__zrefclever_typeset_labels_seq
\l__zrefclever_label_b_tl
}
-
\tl_if_eq:NnTF \l__zrefclever_ref_property_tl { page }
{
\tl_set:Nn \l__zrefclever_label_type_a_tl { page }
@@ -3907,7 +3879,6 @@
\l__zrefclever_label_type_b_tl
\l__zrefclever_label_b_tl { zc at type } { zc at missingtype }
}
-
% First, we establish whether the "current label" (i.e. `a') is the
% last one of its type. This can happen because the "next label"
% (i.e. `b') is of a different type (or different definition status),
@@ -3934,7 +3905,6 @@
}
}
}
-
% Handle warnings in case of reference or type undefined.
% Test: `zc-typeset01.lvt': "Typeset refs: warn ref undefined"
\zref at refused { \l__zrefclever_label_a_tl }
@@ -3957,7 +3927,6 @@
{ \l__zrefclever_label_a_tl }
}
}
-
% Get possibly type-specific separators, refbounds, font and other
% options, once per type.
\int_compare:nNnT { \l__zrefclever_label_count_int } = { 0 }
@@ -4051,7 +4020,6 @@
{ \l__zrefclever_ref_language_tl }
\l__zrefclever_refbounds_last_re_seq
}
-
% Here we send this to a couple of auxiliary functions.
\bool_if:NTF \l__zrefclever_last_of_type_bool
% There exists no next label of the same type as the current.
@@ -4078,7 +4046,6 @@
\l__zrefclever_refbounds_first_sg_seq
\bool_set_true:N \l__zrefclever_type_first_refbounds_set_bool
}
-
% The last is the second: we have a pair (if not repeated).
% Test: `zc-typeset01.lvt': "Last of type: pair"
{ 1 }
@@ -4312,7 +4279,6 @@
}
}
}
-
% Handle "range" option. The idea is simple: if the queue is not empty,
% we replace it with the end of the range (or pair). We can still
% retrieve the end of the range from `label_a' since we know to be
@@ -4390,7 +4356,6 @@
}
}
}
-
% If none of the special cases for the first of type refbounds have been
% set, do it.
\bool_if:NF \l__zrefclever_type_first_refbounds_set_bool
@@ -4398,7 +4363,6 @@
\seq_set_eq:NN \l__zrefclever_type_first_refbounds_seq
\l__zrefclever_refbounds_first_seq
}
-
% Now that the type block is finished, we can add the name and the first
% ref to the queue. Also, if "typeset" option is not "both", handle it
% here as well.
@@ -4428,24 +4392,24 @@
\bool_if:NTF \l__zrefclever_name_in_link_bool
{
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_namefont_tl
- \__zrefclever_hyperlink:nnn
- {
- \__zrefclever_extract_url_unexp:V
- \l__zrefclever_type_first_label_tl
- }
- {
- \__zrefclever_extract_unexp:Vnn
- \l__zrefclever_type_first_label_tl
- { anchor } { }
- }
- { \exp_not:V \l__zrefclever_type_name_tl }
+ \exp_not:V \l__zrefclever_namefont_tl
+ \__zrefclever_hyperlink:nnn
+ {
+ \__zrefclever_extract_url_unexp:V
+ \l__zrefclever_type_first_label_tl
+ }
+ {
+ \__zrefclever_extract_unexp:Vnn
+ \l__zrefclever_type_first_label_tl
+ { anchor } { }
+ }
+ { \exp_not:V \l__zrefclever_type_name_tl }
\exp_not:N \group_end:
}
{
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_namefont_tl
- \exp_not:V \l__zrefclever_type_name_tl
+ \exp_not:V \l__zrefclever_namefont_tl
+ \exp_not:V \l__zrefclever_type_name_tl
\exp_not:N \group_end:
}
}
@@ -4461,7 +4425,6 @@
}
}
}
-
% Typeset the previous type block, if there is one.
\int_compare:nNnT { \l__zrefclever_type_count_int } > { 0 }
{
@@ -4469,11 +4432,9 @@
{ \l__zrefclever_tlistsep_tl }
\l__zrefclever_typeset_queue_prev_tl
}
-
% Extra log for testing.
\bool_if:NT \l__zrefclever_verbose_testing_bool
{ \tl_show:N \l__zrefclever_typeset_queue_curr_tl }
-
% Wrap up loop, or prepare for next iteration.
\bool_if:NTF \l__zrefclever_typeset_last_bool
{
@@ -4540,7 +4501,6 @@
{ \l__zrefclever_label_a_tl } { \l__zrefclever_label_b_tl }
}
}
-
% Process the current label to the current queue.
\int_compare:nNnTF { \l__zrefclever_label_count_int } = { 0 }
{
@@ -4551,7 +4511,6 @@
\tl_set:NV \l__zrefclever_type_first_label_type_tl
\l__zrefclever_label_type_a_tl
\int_incr:N \l__zrefclever_ref_count_int
-
% If the next label may be part of a range, signal it (we deal with it
% as the "first", and must do it there, to handle hyperlinking), but
% also step the range counters.
@@ -4793,9 +4752,9 @@
{
\seq_item:Nn #2 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_reffont_tl
- \__zrefclever_extract_unexp:nvn {#1}
- { l__zrefclever_ref_property_tl } { }
+ \exp_not:V \l__zrefclever_reffont_tl
+ \__zrefclever_extract_unexp:nvn {#1}
+ { l__zrefclever_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn #2 { 3 }
}
@@ -4805,9 +4764,9 @@
\seq_item:Nn #2 { 1 }
\seq_item:Nn #2 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_reffont_tl
- \__zrefclever_extract_unexp:nvn {#1}
- { l__zrefclever_ref_property_tl } { }
+ \exp_not:V \l__zrefclever_reffont_tl
+ \__zrefclever_extract_unexp:nvn {#1}
+ { l__zrefclever_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn #2 { 3 }
\seq_item:Nn #2 { 4 }
@@ -4834,8 +4793,8 @@
{
\seq_item:Nn #3 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_reffont_tl
- \exp_not:n {#2}
+ \exp_not:V \l__zrefclever_reffont_tl
+ \exp_not:n {#2}
\exp_not:N \group_end:
\seq_item:Nn #3 { 3 }
}
@@ -4845,8 +4804,8 @@
\seq_item:Nn #3 { 1 }
\seq_item:Nn #3 { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_reffont_tl
- \exp_not:n {#2}
+ \exp_not:V \l__zrefclever_reffont_tl
+ \exp_not:n {#2}
\exp_not:N \group_end:
\seq_item:Nn #3 { 3 }
\seq_item:Nn #3 { 4 }
@@ -4876,17 +4835,17 @@
}
{
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_namefont_tl
- \exp_not:V \l__zrefclever_type_name_tl
+ \exp_not:V \l__zrefclever_namefont_tl
+ \exp_not:V \l__zrefclever_type_name_tl
\exp_not:N \group_end:
\exp_not:V \l__zrefclever_namesep_tl
\seq_item:Nn \l__zrefclever_type_first_refbounds_seq { 1 }
\seq_item:Nn \l__zrefclever_type_first_refbounds_seq { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_reffont_tl
- \__zrefclever_extract_unexp:Vvn
- \l__zrefclever_type_first_label_tl
- { l__zrefclever_ref_property_tl } { }
+ \exp_not:V \l__zrefclever_reffont_tl
+ \__zrefclever_extract_unexp:Vvn
+ \l__zrefclever_type_first_label_tl
+ { l__zrefclever_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn \l__zrefclever_type_first_refbounds_seq { 3 }
}
@@ -4894,8 +4853,8 @@
}
{
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_namefont_tl
- \exp_not:V \l__zrefclever_type_name_tl
+ \exp_not:V \l__zrefclever_namefont_tl
+ \exp_not:V \l__zrefclever_type_name_tl
\exp_not:N \group_end:
\exp_not:V \l__zrefclever_namesep_tl
\__zrefclever_ref_default:
@@ -4909,8 +4868,8 @@
}
{
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_namefont_tl
- \exp_not:V \l__zrefclever_type_name_tl
+ \exp_not:V \l__zrefclever_namefont_tl
+ \exp_not:V \l__zrefclever_type_name_tl
\exp_not:N \group_end:
\tl_if_empty:NF \l__zrefclever_type_name_tl
{ \exp_not:V \l__zrefclever_namesep_tl }
@@ -4940,10 +4899,10 @@
\seq_item:Nn
\l__zrefclever_type_first_refbounds_seq { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_reffont_tl
- \__zrefclever_extract_unexp:Vvn
- \l__zrefclever_type_first_label_tl
- { l__zrefclever_ref_property_tl } { }
+ \exp_not:V \l__zrefclever_reffont_tl
+ \__zrefclever_extract_unexp:Vvn
+ \l__zrefclever_type_first_label_tl
+ { l__zrefclever_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn
\l__zrefclever_type_first_refbounds_seq { 3 }
@@ -4955,10 +4914,10 @@
\seq_item:Nn \l__zrefclever_type_first_refbounds_seq { 1 }
\seq_item:Nn \l__zrefclever_type_first_refbounds_seq { 2 }
\exp_not:N \group_begin:
- \exp_not:V \l__zrefclever_reffont_tl
- \__zrefclever_extract_unexp:Vvn
- \l__zrefclever_type_first_label_tl
- { l__zrefclever_ref_property_tl } { }
+ \exp_not:V \l__zrefclever_reffont_tl
+ \__zrefclever_extract_unexp:Vvn
+ \l__zrefclever_type_first_label_tl
+ { l__zrefclever_ref_property_tl } { }
\exp_not:N \group_end:
\seq_item:Nn \l__zrefclever_type_first_refbounds_seq { 3 }
\seq_item:Nn \l__zrefclever_type_first_refbounds_seq { 4 }
@@ -5022,7 +4981,6 @@
\tl_put_right:Nn \l__zrefclever_name_format_tl { -ab }
}
{ \tl_clear:N \l__zrefclever_name_format_fallback_tl }
-
% Handle number and gender nudges.
% Note that these nudges get disabled for `typeset=ref' /
% `noname' option, but in this case they are not really
@@ -5088,7 +5046,6 @@
}
}
}
-
\tl_if_empty:NTF \l__zrefclever_name_format_fallback_tl
{
\__zrefclever_opt_tl_get:cNF
@@ -5189,7 +5146,6 @@
}
}
}
-
% Signal whether the type name is to be included in the hyperlink or
% not.
\bool_lazy_any:nTF
@@ -5251,13 +5207,13 @@
{
\int_compare:nNnTF
{ \__zrefclever_extract:nnn {#1} { zc at pgval } { -2 } + 1 }
- =
+ =
{ \__zrefclever_extract:nnn {#2} { zc at pgval } { -1 } }
{ \bool_set_true:N \l__zrefclever_next_maybe_range_bool }
{
\int_compare:nNnT
{ \__zrefclever_extract:nnn {#1} { zc at pgval } { -1 } }
- =
+ =
{ \__zrefclever_extract:nnn {#2} { zc at pgval } { -1 } }
{
\bool_set_true:N \l__zrefclever_next_maybe_range_bool
@@ -5277,13 +5233,13 @@
{
\int_compare:nNnTF
{ \__zrefclever_extract:nnn {#1} { zc at cntval } { -2 } + 1 }
- =
+ =
{ \__zrefclever_extract:nnn {#2} { zc at cntval } { -1 } }
{ \bool_set_true:N \l__zrefclever_next_maybe_range_bool }
{
\int_compare:nNnT
{ \__zrefclever_extract:nnn {#1} { zc at cntval } { -1 } }
- =
+ =
{ \__zrefclever_extract:nnn {#2} { zc at cntval } { -1 } }
{
\exp_args:Nee \tl_if_eq:nnT
More information about the tex-live-commits
mailing list.