[latex3-commits] [latex3/hyperref] develop, test-currentHpage: add support for \@currentHpage (6072a51)
github at latex-project.org
github at latex-project.org
Mon Oct 16 00:37:35 CEST 2023
Repository : https://github.com/latex3/hyperref
On branches: develop,test-currentHpage
Link : https://github.com/latex3/hyperref/commit/6072a5102be8bacd9e38392ce7e885865981c0e5
>---------------------------------------------------------------
commit 6072a5102be8bacd9e38392ce7e885865981c0e5
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Mon Oct 16 00:37:35 2023 +0200
add support for \@currentHpage
>---------------------------------------------------------------
6072a5102be8bacd9e38392ce7e885865981c0e5
ChangeLog.txt | 9 ++++++---
build.lua | 4 ++--
config-dev.lua | 4 ++++
doc/hyperref-doc.tex | 12 +++++++-----
testfiles-dev/pagetarget.lvt | 22 ++++++++++++++++++++++
5 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 16990e1..ea161a0 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,6 +1,9 @@
-2023-10-12 Ulrike Fischer
- * hyperref.dtx: handle \TextOrMath in \pdfstringdef, issue 303
- * support babel languages loaded with main or with \babelprovide, issue 165
+2023-10-16 Ulrike Fischer
+ * hyperref.dtx: add \@currentHpage support
+
+2023-10-12 Ulrike Fischer * hyperref.dtx: handle \TextOrMath in
+ \pdfstringdef, issue 303 * support babel languages loaded with main or
+ with \babelprovide, issue 165
2023-10-05 Ulrike Fischer
* nameref.dtx: add missing nameref nopatches issue 302
diff --git a/build.lua b/build.lua
index 91ad55f..a703624 100644
--- a/build.lua
+++ b/build.lua
@@ -70,13 +70,13 @@ specialformats["latex"] = specialformats["latex"] or
}
-checkconfigs = {"build","config-pvt","config-3","config-xetex"}
+checkconfigs = {"build","config-pvt","config-3","config-xetex","config-pdftex"}
checkengines = {"pdftex","etex","luatex"}
-- for dev testing
-- checkengines = {"pdftex","pdftexdev","etex","luatex"}
-- checkengines = {"pdftex","pdftexdev"}
-
+-- checkconfigs = {"config-dev"}
-- temp settings disable checks while testing ctan build
-- testfiledir= "disabled"
-- checkconfigs={}
diff --git a/config-dev.lua b/config-dev.lua
new file mode 100644
index 0000000..38c4d43
--- /dev/null
+++ b/config-dev.lua
@@ -0,0 +1,4 @@
+testfiledir = "testfiles-dev"
+testsuppdir = testfiledir .. "/support"
+checkruns=3
+checkengines = {"pdftexdev"}
diff --git a/doc/hyperref-doc.tex b/doc/hyperref-doc.tex
index 27bd065..33b3547 100644
--- a/doc/hyperref-doc.tex
+++ b/doc/hyperref-doc.tex
@@ -845,15 +845,17 @@ In a PDF \xpackage{hyperref} adds to every page an target for links (in the uppe
\begin{cmdsyntax}
\ci{@currentHpage}
\end{cmdsyntax}
-\marginpar{Experimental!}Starting with version 7.01c \xpackage{hyperref} stores the name of the page target it has just set into the (global) variable \cs{@currentHpage}. The fallback value is \texttt{Doc-Start}. As the target is set when the page is shipout, \cs{@currentHpage} is only reliable at shipout. With a \hologo{LaTeX} format from 2023-11-01 the name can be for labeled by a package like this:
+Starting with version 7.01c \xpackage{hyperref} stores the name of the page
+target it has just set into the (global) variable \cs{@currentHpage}. The
+fallback value is \texttt{Doc-Start}. As the target is set when the page is
+shipout, \cs{@currentHpage} is only reliable at shipout. With a
+\hologo{LaTeX} format from 2023-11-01 the name can be labeled like this:
\begin{verbatim}
-%preamble
-\NewProperty{mypackage/pagetarget}{shipout}{Doc-Start}{\csname @currentHpage\endcsname}
%labeling in the document
-\RecordProperties{mylabel}{mypackage/pagetarget}
+\RecordProperties{mylabel}{pagetarget}
%linking to the page:
-\hyperlink{\RefProperty{mylabel}{mypackage/pagetarget}}{some text}
+\hyperlink{\RefProperty{mylabel}{pagetarget}}{some text}
\end{verbatim}
diff --git a/testfiles-dev/pagetarget.lvt b/testfiles-dev/pagetarget.lvt
new file mode 100644
index 0000000..61eb18f
--- /dev/null
+++ b/testfiles-dev/pagetarget.lvt
@@ -0,0 +1,22 @@
+\PassOptionsToPackage{enable-debug,check-declarations}{expl3}
+\input{regression-test}
+\documentclass{article}
+\input{regression-test}
+\documentclass{article}
+\ExplSyntaxOn
+\sys_if_engine_pdftex:T {\usepackage[LGR]{fontenc}}
+\ExplSyntaxOff
+\usepackage[pdfpagelabels=true
+]{hyperref}
+\START
+\SHOWFILE{\jobname.aux}
+\renewcommand\thepage{λέγ\arabic{page}}
+\OMIT
+\begin{document}
+\TIMO \hyperlink{\RefProperty{A}{pagetarget}}{some text}
+\hyperlink{\RefProperty{B}{pagetarget}}{some text}
+
+abc \newpage abc \newpage A \RecordProperties{A}{page,pagetarget}
+\newpage \fontencoding{T1}\selectfont\pagenumbering{Roman}\setcounter{page}{5} B
+\RecordProperties{B}{page,pagetarget}
+\end{document}
More information about the latex3-commits
mailing list.