[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: * varioref.dtx (subsubsection{Supporting ranges}): Use 3 additional (empty) arguments as default in case nameref is active (sx/603948) (121de76e)

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Jul 7 09:52:33 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/121de76e930fa0ebcfd490b0c0c251eaf3b2db58

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

commit 121de76e930fa0ebcfd490b0c0c251eaf3b2db58
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Jul 7 09:52:33 2021 +0200

    * varioref.dtx (subsubsection{Supporting ranges}):
            Use 3 additional (empty) arguments as default in case
            nameref is active (sx/603948)


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

121de76e930fa0ebcfd490b0c0c251eaf3b2db58
 base/doc/ltnews34.tex                              | 12 ++++++++++
 required/tools/changes.txt                         |  6 +++++
 required/tools/testfiles-search/sx603948.lvt       | 27 ++++++++++++++++++++++
 required/tools/testfiles-search/sx603948.tlg       | 12 ++++++++++
 .../tools/testfiles-search/tlb-varioref-007.tlg    |  2 +-
 required/tools/varioref.dtx                        |  6 +++--
 6 files changed, 62 insertions(+), 3 deletions(-)

diff --git a/base/doc/ltnews34.tex b/base/doc/ltnews34.tex
index 179de90c..215ddadc 100644
--- a/base/doc/ltnews34.tex
+++ b/base/doc/ltnews34.tex
@@ -179,6 +179,18 @@ will work without needing \verb|\DeclareUnicodeCharacter| declarations.
 
 \section{Changes to packages in the \pkg{tools} category}
 
+\subsection{\pkg{varioref}: Improve missing label handling}
+
+If an undefined label is referenced, \pkg{varioref} makes a default
+definition so that later processing finds the right structure (two
+brace groups inside \cs{r@}\meta{label}) However, if \pkg{nameref} or
+\pkg{hyperref} is loaded, the data structure changes to five
+arguments, resulting in low-evel errors in some cases. The code has
+been changed to avoid these errors.
+%
+\sxissue{603948}
+
+
 \subsection{???}
 
 %
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 97b80b9e..048478b8 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,6 +5,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2021-07-07  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* varioref.dtx (subsubsection{Supporting ranges}):
+	Use 3 additional (empty) arguments as default in case
+	nameref is active (sx/603948)
+
 2021-07-06  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* multicol.dtx (subsection{The output routines}]):
diff --git a/required/tools/testfiles-search/sx603948.lvt b/required/tools/testfiles-search/sx603948.lvt
new file mode 100644
index 00000000..321404e9
--- /dev/null
+++ b/required/tools/testfiles-search/sx603948.lvt
@@ -0,0 +1,27 @@
+\documentclass{article}
+
+\input{test2e}
+
+\usepackage{nameref,varioref}
+
+\begin{filecontents}[force]{\jobname-x}
+\vpageref{aRef} % or \vref{aRef}
+\end{filecontents}
+
+
+\begin{document}
+
+\START
+
+\typeout{No error:}
+
+\include{\jobname-x}
+
+
+xxx \nameref{blub}
+
+\vpageref{blub}
+
+xxx \nameref{blub}
+
+\end{document}
diff --git a/required/tools/testfiles-search/sx603948.tlg b/required/tools/testfiles-search/sx603948.tlg
new file mode 100644
index 00000000..bd02008e
--- /dev/null
+++ b/required/tools/testfiles-search/sx603948.tlg
@@ -0,0 +1,12 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+No error:
+(sx603948-x.tex
+LaTeX Warning: Reference `aRef' on page 1 undefined on input line ....
+) [1
+]
+LaTeX Warning: Reference `blub' on page 2 undefined on input line ....
+LaTeX Warning: Reference `blub' on page 2 undefined on input line ....
+[2
+] (sx603948.aux (sx603948-x.aux))
+LaTeX Warning: There were undefined references.
diff --git a/required/tools/testfiles-search/tlb-varioref-007.tlg b/required/tools/testfiles-search/tlb-varioref-007.tlg
index 0e3151c7..1af3e1ea 100644
--- a/required/tools/testfiles-search/tlb-varioref-007.tlg
+++ b/required/tools/testfiles-search/tlb-varioref-007.tlg
@@ -8,6 +8,6 @@ C near current point (3\hbox {} <> 3 approx)
 D near current point (4\hbox {} <> 3 approx)
 E away from current (5\hbox {} <> 3 approx)
 LaTeX Warning: Reference `undef' on page 3 undefined on input line ....
-undef away from current (??\hbox {} <> 3 approx)
+undef away from current (??{}{}{}\hbox {} <> 3 approx)
 [3] [4] [5] (tlb-varioref-007.aux)
 LaTeX Warning: There were undefined references.
diff --git a/required/tools/varioref.dtx b/required/tools/varioref.dtx
index eac06580..faf8b038 100644
--- a/required/tools/varioref.dtx
+++ b/required/tools/varioref.dtx
@@ -40,7 +40,7 @@
 %<package>\DeclareCurrentRelease{}{2019-10-01}
 %<package>
 %<package>\ProvidesPackage{varioref}
-%<package>    [2020/08/11 v1.6e package for extended references (FMi)]
+%<package>    [2021/07/07 v1.6f package for extended references (FMi)]
 % \fi
 %
 %%
@@ -2413,9 +2413,11 @@
 %    and the page, thus defining the label this way.  This means that
 %    no label warning is generated for this label in case it is
 %    undefined.
+% \changes{v1.6f}{2021/07/07}{Use 3 additional (empty) arguments as
+%                              default in case nameref is active}
 %    \begin{macrocode}
 \def\vref at pagenum#1#2{%
-  \@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}}}{}%
+  \@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}{}{}{}}}{}%
 %    \end{macrocode}
 %    Extracting and saving the page number turned out to be a source of subtle
 %    bugs. Initially it was done through an |\edef| with a bunch of





More information about the latex3-commits mailing list.