[latex3-commits] [latex3/hyperref] develop: sort thm-code, issue #304 (e127479)

github at latex-project.org github at latex-project.org
Tue Nov 7 17:16:45 CET 2023


Repository : https://github.com/latex3/hyperref
On branch  : develop
Link       : https://github.com/latex3/hyperref/commit/e1274797c8affb75799584001d1435a0c2e8f80e

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

commit e1274797c8affb75799584001d1435a0c2e8f80e
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Nov 7 17:16:45 2023 +0100

    sort thm-code, issue #304


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

e1274797c8affb75799584001d1435a0c2e8f80e
 doc/hyperref-doc.tex                  |   6 +
 hyperref.dtx                          |  80 ++++++++++---
 testfiles-pdftex/thm-005-amsthm.lvt   |  22 ++++
 testfiles-pdftex/thm-005-amsthm.tlg   | 204 ++++++++++++++++++++++++++++++++
 testfiles-pdftex/thm-005-ntheorem.lvt |  21 ++++
 testfiles-pdftex/thm-005-ntheorem.tlg | 217 ++++++++++++++++++++++++++++++++++
 testfiles-pdftex/thm-005.lvt          |  22 ++++
 testfiles-pdftex/thm-005.tlg          | 208 ++++++++++++++++++++++++++++++++
 testfiles-pdftex/thm-006-gh304.lvt    |  15 +++
 testfiles-pdftex/thm-006-gh304.tlg    |  83 +++++++++++++
 10 files changed, 859 insertions(+), 19 deletions(-)

diff --git a/doc/hyperref-doc.tex b/doc/hyperref-doc.tex
index e7e21d6..d5e2147 100644
--- a/doc/hyperref-doc.tex
+++ b/doc/hyperref-doc.tex
@@ -3111,6 +3111,12 @@ Example for introducing links for the page numbers:
       \renewcommand*{\pagedeclaration}[1]{\unskip, \hyperpage{#1}}
 \end{verbatim}
 
+\subsubsection{ntheorem}
+
+This package is not fully supported. The \texttt{thref} option should not be used at all as
+it breaks the \verb+\label+ command. It also not garantied that links to theorems always work
+properly as the package redefines many internals and but offers no proper interface for hyperlinks.
+
 
 \subsubsection{ntheorem-hyper}
  This package is obsolete, use the up-to-date original
diff --git a/hyperref.dtx b/hyperref.dtx
index 0c5340d..dbca098 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -10967,14 +10967,52 @@
  } 
 %    \end{macrocode}
 %
-% Support for theorems. We move the target into the para hook to 
-% avoid spacing problem. The patch will not apply to 
-% \texttt{cleveref} but hopefully it does the right thing anyway.
+% \section{Support for theorems} 
+% 
+% Hyperlink support in theorems has to resolve typically three problems:
+% \begin{itemize}
+% \item The \cs{refstepcounter} can be issued to early. The target it produces
+% can be separated from the theorem and then the link if wrong (see testfiles thm-005-xx). 
+% It can also affect spacing. 
+% This means that it is better if this \cs{refstepcounter} doesn't produce a target.
+%
+% \item The natural place for the target (before the theorem label) is normally not printed
+% directly but delayed to the next paragraph begin (through the \cs{item} code or by other means). 
+% and \cs{label} commands used directly at the begin of the environment are perhaps 
+% processed \emph{before} the target is created 
+% and so do not know the correct \cs{@currentHref} value. That means that if
+% \cs{refstepcounter} does not produce a target, it should nevertheless update the target
+% name.
+% 
+% \item The target should be placed (in horizontal mode) before the theorem label to avoid
+% side effects on spacing. For this a suitable place must be 
+% found depending on the actual theorem definition. 
+% \end{itemize} 
+% 
+% Theorems typically issue the \cs{refstepcounter} in \cs{@thm}. 
+% The first two points can therefore be resolved by patching this command 
+% and replacing the \cs{refstepcounter}. 
+% 
+% The last point is the most complicated. Simply moving at the point \cs{refstepcounter}
+% is encountered into the next para hook doesn't work, as this can be in a header if there is page
+% break. The next item hook doesn't work for the same reason, 
+% also not every theorem environment actually use \cs{item} (e.g. \xpackage{amsthm} and ams-classes).
+% Patching (or using a hook) \cs{@begintheorem} doesn't work either as \xpackage{ntheorem}
+% redefines this on the fly. 
+% 
+% For now we move the target creation into the item hook. This is not perfect,
+% as it can end up in header or be to much to the right, but there is not really
+% a better place.
+% 
+% The patch will not apply to 
+% \texttt{cleveref}, this means that with cleveref there
+% can be a page break between target and theorem but beside this
+% it hopefully it does the right thing.
 % \cs{@currentHref} is updated directly for labels set before 
 % the actual start of the paragraph. The target can be behind
 % a target created from a following list, so we restore \cs{@currentHref}
-% just in case
-% 
+% just in case.
+% Later we could use sockets here (or hope that the packages take this over. 
 % 
 %    \begin{macrocode}
 \newcommand\Hy at theorem@refstepcounter[1]
@@ -10982,33 +11020,37 @@
    \H at refstepcounter{#1}%
    \hyper at makecurrent{#1}%
    \global\let\Hy at dth@currentHref\@currentHref
+   \Hy at theorem@makelinktarget{\Hy at dth@currentHref}%
+  } 
+\newcommand\Hy at theorem@makelinktarget[1]
+ {
    \AddToHookNext{cmd/item/before}
      {\AddToHookNext{para/begin}
        {\let\Hy at tempa\@currentHref
-        \MakeLinkTarget*{\Hy at dth@currentHref}%
+        \MakeLinkTarget*{#1}% \Hy at dth@currentHref
         \global\let\@currentHref\Hy at tempa
        }%
      }%   
-  } 
+ }  
 %    \end{macrocode}
 % amsthm doesn't issue an item in the theorem, we delay the target into
 % \cs{deferred at thm@head} and hope that it always begins a paragraph.
 %    \begin{macrocode}
-\AddToHook{package/amsthm/after}
- {
-  \renewcommand\Hy at theorem@refstepcounter[1]
+\AddToHook{begindocument}
+ {%
+  \@ifundefined{deferred at thm@head}{}
    {%
-    \H at refstepcounter{#1}%
-    \hyper at makecurrent{#1}%
-    \global\let\Hy at dth@currentHref\@currentHref
-    \AddToHookNext{cmd/deferred at thm@head/before}
-     {\AddToHookNext{para/begin}
-       {\let\Hy at tempa\@currentHref
-        \MakeLinkTarget*{\Hy at dth@currentHref}%
-        \global\let\@currentHref\Hy at tempa
+    \renewcommand\Hy at theorem@makelinktarget[1]
+     {%
+      \AddToHookNext{cmd/deferred at thm@head/before}
+       {\AddToHookNext{para/begin}
+         {\let\Hy at tempa\@currentHref
+          \MakeLinkTarget*{#1}%
+          \global\let\@currentHref\Hy at tempa
+         }%
        }%  
      }%
-   }
+   }%
  }  
 \@ifundefined{hyper at nopatch@thm}{%  
 \AtBeginDocument{%  
diff --git a/testfiles-pdftex/thm-005-amsthm.lvt b/testfiles-pdftex/thm-005-amsthm.lvt
new file mode 100644
index 0000000..83b793e
--- /dev/null
+++ b/testfiles-pdftex/thm-005-amsthm.lvt
@@ -0,0 +1,22 @@
+%check if anchor is on the right page!
+\input{regression-test}
+\documentclass[12pt]{book}
+\usepackage{amsthm}
+\newtheorem{theorem}{theorem}
+
+\usepackage{hyperref}
+\begin{document}%
+\START\showoutput
+x
+
+\vspace{30\baselineskip}
+x\\x\\x\\x\\x\\x\\x%
+\begin{theorem}\label{blub}
+xxx
+\end{theorem}
+
+
+\newpage
+\ref{blub}
+
+\end{document}
\ No newline at end of file
diff --git a/testfiles-pdftex/thm-005-amsthm.tlg b/testfiles-pdftex/thm-005-amsthm.tlg
new file mode 100644
index 0000000..c7efc13
--- /dev/null
+++ b/testfiles-pdftex/thm-005-amsthm.tlg
@@ -0,0 +1,204 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+Completed box being shipped out [1]
+\vbox(630.3738+0.0)x407.0
+.\hbox(0.0+0.0)x0.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 15.99626fil
+...\kern 0.0
+...\kern 17.0
+...\kern -1.00374
+...\pdfdest name{page.1} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x407.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 17.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/12 1
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0
+....\write-{}
+....\pdfdest name{Doc-Start} xyz
+....\glue(\topskip) 6.83333
+....\hbox(5.16667+0.0)x390.0, glue set 366.17386fil
+.....\hbox(0.0+0.0)x17.62482
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 435.0
+....\glue 0.0
+....\glue(\parskip) 0.0 plus 1.0
+....\glue(\parskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 366.17386fil
+.....\hbox(0.0+0.0)x17.62482
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\penalty 150
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\penalty 150
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+.\kern 0.0
+Completed box being shipped out [2]
+\vbox(630.3738+0.0)x452.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 60.99626fil
+...\kern 0.0
+...\kern 62.0
+...\kern -1.00374
+...\pdfdest name{page.2} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x452.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 62.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\OT1/cmr/m/n/12 2
+......\glue 0.0 plus 1.0fil
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0, glue set 526.5fil
+....\write1{\newlabel{blub}{{1}{\thepage }{}{theorem.0.0.1}{}}}
+....\glue(\topskip) 3.66669
+....\hbox(8.33331+0.0)x390.0, glue set 305.2165fil
+.....\penalty 10000
+.....\hbox(0.0+0.0)x0.0
+......\hbox(0.0+0.0)x0.0, shifted -14.5
+.......\pdfdest name{theorem.0.0.1} xyz
+.......\penalty 10000
+.....\OT1/cmr/bx/n/12 t
+.....\OT1/cmr/bx/n/12 h
+.....\OT1/cmr/bx/n/12 e
+.....\OT1/cmr/bx/n/12 o
+.....\OT1/cmr/bx/n/12 r
+.....\OT1/cmr/bx/n/12 e
+.....\OT1/cmr/bx/n/12 m
+.....\kern 0.0
+.....\glue 4.5 plus 2.25 minus 1.5
+.....\OT1/cmr/bx/n/12 1
+.....\kern 0.0
+.....\OT1/cmr/bx/n/12 .
+.....\glue 5.0 plus 1.0 minus 1.0
+.....\OT1/cmr/m/it/12 x
+.....\OT1/cmr/m/it/12 x
+.....\OT1/cmr/m/it/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\penalty -51
+....\glue 10.0 plus 4.0 minus 6.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+Completed box being shipped out [3]
+\vbox(630.3738+0.0)x407.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 15.99626fil
+...\kern 0.0
+...\kern 17.0
+...\kern -1.00374
+...\pdfdest name{page.3} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x407.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 17.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/12 3
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0, glue set 536.5fil
+....\glue(\topskip) 4.26668
+....\hbox(7.73332+0.0)x390.0, glue set 366.50024fil
+.....\hbox(0.0+0.0)x17.62482
+.....\pdfstartlink(*+*)x* attr{/Border[0 0 1]/H/I/C[1 0 0]} action goto name{theorem.0.0.1}
+.....\OT1/cmr/m/n/12 1
+.....\pdfendlink
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+(thm-005-amsthm.aux)
+Package rerunfilecheck Info: File `thm-005-amsthm.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/testfiles-pdftex/thm-005-ntheorem.lvt b/testfiles-pdftex/thm-005-ntheorem.lvt
new file mode 100644
index 0000000..1c86669
--- /dev/null
+++ b/testfiles-pdftex/thm-005-ntheorem.lvt
@@ -0,0 +1,21 @@
+%check if anchor is on the right page!
+\input{regression-test}
+\documentclass[12pt]{book}
+\usepackage{ntheorem}
+\newtheorem{theorem}{theorem}
+\usepackage{hyperref}
+\begin{document}%
+\START\showoutput
+x
+
+\vspace{30\baselineskip}
+x\\x\\x\\x\\x\\x\\x%
+\begin{theorem}\label{blub}
+xxx
+\end{theorem}
+
+
+\newpage
+\ref{blub}
+
+\end{document} 
\ No newline at end of file
diff --git a/testfiles-pdftex/thm-005-ntheorem.tlg b/testfiles-pdftex/thm-005-ntheorem.tlg
new file mode 100644
index 0000000..c9a7ee4
--- /dev/null
+++ b/testfiles-pdftex/thm-005-ntheorem.tlg
@@ -0,0 +1,217 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <12> on input line ....
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <8> on input line ....
+LaTeX Font Info:    External font `cmex10' loaded for size
+(Font)              <6> on input line ....
+Package hyperref Info: bookmark level for unknown theorem defaults to 0 on input line ....
+Completed box being shipped out [1]
+\vbox(630.3738+0.0)x407.0
+.\hbox(0.0+0.0)x0.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 15.99626fil
+...\kern 0.0
+...\kern 17.0
+...\kern -1.00374
+...\pdfdest name{page.1} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x407.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 17.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/12 1
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0
+....\write-{}
+....\pdfdest name{Doc-Start} xyz
+....\glue(\topskip) 6.83333
+....\hbox(5.16667+0.0)x390.0, glue set 366.17386fil
+.....\hbox(0.0+0.0)x17.62482
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 435.0
+....\glue 0.0
+....\glue(\parskip) 0.0 plus 1.0
+....\glue(\parskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 366.17386fil
+.....\hbox(0.0+0.0)x17.62482
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\penalty 150
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\penalty 150
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+.\kern 0.0
+Completed box being shipped out [2]
+\vbox(630.3738+0.0)x452.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 60.99626fil
+...\kern 0.0
+...\kern 62.0
+...\kern -1.00374
+...\pdfdest name{page.2} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x452.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 62.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\OT1/cmr/m/n/12 2
+......\glue 0.0 plus 1.0fil
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0, glue set 523.5fil
+....\write1{\@writefile{thm}{\protect \contentsline {theorem}{{theorem}{1}{}}{\thepage }{theorem.0.0.1}\protected at file@percent }}
+....\write1{\newlabel{blub}{{1}{\thepage }{}{theorem.0.0.1}{}}}
+....\glue(\topskip) 3.66669
+....\hbox(8.33331+0.0)x390.0, glue set 308.09157fil
+.....\penalty 10000
+.....\hbox(0.0+0.0)x0.0
+......\hbox(0.0+0.0)x0.0, shifted -14.5
+.......\pdfdest name{theorem.0.0.1} xyz
+.......\penalty 10000
+.....\hbox(8.33331+0.0)x65.70827
+......\glue 0.0
+......\glue 0.0
+......\glue -5.87494
+......\hbox(8.33331+0.0)x65.70827
+.......\glue 5.87494
+.......\OT1/cmr/bx/n/12 t
+.......\OT1/cmr/bx/n/12 h
+.......\OT1/cmr/bx/n/12 e
+.......\OT1/cmr/bx/n/12 o
+.......\OT1/cmr/bx/n/12 r
+.......\OT1/cmr/bx/n/12 e
+.......\OT1/cmr/bx/n/12 m
+.......\glue 4.5 plus 2.25 minus 1.5
+.......\OT1/cmr/bx/n/12 1
+......\glue 5.87494
+.....\penalty 0
+.....\OT1/cmr/m/it/12 x
+.....\OT1/cmr/m/it/12 x
+.....\OT1/cmr/m/it/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\penalty -51
+....\glue 13.0 plus 6.0 minus 8.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+\tf at thm=\write...
+Completed box being shipped out [3]
+\vbox(630.3738+0.0)x407.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 15.99626fil
+...\kern 0.0
+...\kern 17.0
+...\kern -1.00374
+...\pdfdest name{page.3} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x407.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 17.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/12 3
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0, glue set 536.5fil
+....\glue(\topskip) 4.26668
+....\hbox(7.73332+0.0)x390.0, glue set 366.50024fil
+.....\hbox(0.0+0.0)x17.62482
+.....\pdfstartlink(*+*)x* attr{/Border[0 0 1]/H/I/C[1 0 0]} action goto name{theorem.0.0.1}
+.....\OT1/cmr/m/n/12 1
+.....\pdfendlink
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+(thm-005-ntheorem.aux)
+Package rerunfilecheck Info: File `thm-005-ntheorem.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/testfiles-pdftex/thm-005.lvt b/testfiles-pdftex/thm-005.lvt
new file mode 100644
index 0000000..1f9e130
--- /dev/null
+++ b/testfiles-pdftex/thm-005.lvt
@@ -0,0 +1,22 @@
+%check if anchor is on the right page!
+\input{regression-test}
+\documentclass[12pt]{book}
+
+\newtheorem{theorem}{theorem}
+
+\usepackage{hyperref}
+\begin{document}%
+\START\showoutput
+x
+
+\vspace{30\baselineskip}
+x\\x\\x\\x\\x\\x\\x%
+\begin{theorem}\label{blub}
+xxx
+\end{theorem}
+
+
+\newpage
+\ref{blub}
+
+\end{document}
\ No newline at end of file
diff --git a/testfiles-pdftex/thm-005.tlg b/testfiles-pdftex/thm-005.tlg
new file mode 100644
index 0000000..57a6948
--- /dev/null
+++ b/testfiles-pdftex/thm-005.tlg
@@ -0,0 +1,208 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+Completed box being shipped out [1]
+\vbox(630.3738+0.0)x407.0
+.\hbox(0.0+0.0)x0.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 15.99626fil
+...\kern 0.0
+...\kern 17.0
+...\kern -1.00374
+...\pdfdest name{page.1} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x407.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 17.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/12 1
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0
+....\write-{}
+....\pdfdest name{Doc-Start} xyz
+....\glue(\topskip) 6.83333
+....\hbox(5.16667+0.0)x390.0, glue set 366.17386fil
+.....\hbox(0.0+0.0)x17.62482
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 435.0
+....\glue 0.0
+....\glue(\parskip) 0.0 plus 1.0
+....\glue(\parskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 366.17386fil
+.....\hbox(0.0+0.0)x17.62482
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\penalty 150
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue 0.0 plus 1.0fil
+.....\penalty -10000
+.....\glue(\rightskip) 0.0
+....\penalty 150
+....\glue(\baselineskip) 9.33333
+....\hbox(5.16667+0.0)x390.0, glue set 383.79868fil
+.....\OT1/cmr/m/n/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+.\kern 0.0
+Completed box being shipped out [2]
+\vbox(630.3738+0.0)x452.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 60.99626fil
+...\kern 0.0
+...\kern 62.0
+...\kern -1.00374
+...\pdfdest name{page.2} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x452.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 62.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\OT1/cmr/m/n/12 2
+......\glue 0.0 plus 1.0fil
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0, glue set 526.5fil
+....\write1{\newlabel{blub}{{1}{\thepage }{}{theorem.0.0.1}{}}}
+....\glue(\topskip) 3.66669
+....\hbox(8.33331+0.0)x390.0, glue set 308.09157fil
+.....\penalty 10000
+.....\hbox(0.0+0.0)x0.0
+......\hbox(0.0+0.0)x0.0, shifted -14.5
+.......\pdfdest name{theorem.0.0.1} xyz
+.......\penalty 10000
+.....\hbox(8.33331+0.0)x65.70827
+......\glue 0.0
+......\glue 0.0
+......\glue -5.87494
+......\hbox(8.33331+0.0)x65.70827
+.......\glue 5.87494
+.......\OT1/cmr/bx/n/12 t
+.......\OT1/cmr/bx/n/12 h
+.......\OT1/cmr/bx/n/12 e
+.......\OT1/cmr/bx/n/12 o
+.......\OT1/cmr/bx/n/12 r
+.......\OT1/cmr/bx/n/12 e
+.......\OT1/cmr/bx/n/12 m
+.......\glue 4.5 plus 2.25 minus 1.5
+.......\OT1/cmr/bx/n/12 1
+......\glue 5.87494
+.....\penalty 0
+.....\OT1/cmr/m/it/12 x
+.....\OT1/cmr/m/it/12 x
+.....\OT1/cmr/m/it/12 x
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\penalty -51
+....\glue 10.0 plus 4.0 minus 6.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+Completed box being shipped out [3]
+\vbox(630.3738+0.0)x407.0
+.\vbox(0.0+0.0)x0.0, glue set - 18.99626fil
+..\kern 0.0
+..\kern 20.0
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 15.99626fil
+...\kern 0.0
+...\kern 17.0
+...\kern -1.00374
+...\pdfdest name{page.3} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(630.3738+0.0)x407.0
+..\glue 20.0
+..\vbox(610.3738+0.0)x390.0, shifted 17.0
+...\vbox(12.0+0.0)x390.0, glue set 4.26668fil
+....\glue 0.0 plus 1.0fil
+....\hbox(7.73332+0.0)x390.0
+.....\hbox(7.73332+0.0)x390.0, glue set 384.12506fil
+......\glue 0.0 plus 1.0fil
+......\OT1/cmr/m/n/12 3
+...\glue 19.8738
+...\glue(\lineskip) 0.0
+...\vbox(548.5+0.0)x390.0, glue set 536.5fil
+....\glue(\topskip) 4.26668
+....\hbox(7.73332+0.0)x390.0, glue set 366.50024fil
+.....\hbox(0.0+0.0)x17.62482
+.....\pdfstartlink(*+*)x* attr{/Border[0 0 1]/H/I/C[1 0 0]} action goto name{theorem.0.0.1}
+.....\OT1/cmr/m/n/12 1
+.....\pdfendlink
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 30.0
+...\hbox(0.0+0.0)x390.0
+....\hbox(0.0+0.0)x390.0
+(thm-005.aux)
+Package rerunfilecheck Info: File `thm-005.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
diff --git a/testfiles-pdftex/thm-006-gh304.lvt b/testfiles-pdftex/thm-006-gh304.lvt
new file mode 100644
index 0000000..87bc87c
--- /dev/null
+++ b/testfiles-pdftex/thm-006-gh304.lvt
@@ -0,0 +1,15 @@
+\input{regression-test}
+\documentclass{amsart}
+\usepackage{hyperref}
+
+\newtheorem{thmx}{Theorem}
+
+\begin{document}\START\showoutput
+
+\begin{thmx}\label{t:a}
+   a
+\end{thmx}
+
+By \ref{t:a} 
+
+\end{document}
\ No newline at end of file
diff --git a/testfiles-pdftex/thm-006-gh304.tlg b/testfiles-pdftex/thm-006-gh304.tlg
new file mode 100644
index 0000000..b373e75
--- /dev/null
+++ b/testfiles-pdftex/thm-006-gh304.tlg
@@ -0,0 +1,83 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+Completed box being shipped out [1]
+\vbox(640.215+0.0)x414.8775
+.\hbox(0.0+0.0)x0.0
+.\vbox(0.0+0.0)x0.0, glue set - 21.21126fil
+..\kern 0.0
+..\kern 22.215
+..\kern -1.00374
+..\hbox(0.0+0.0)x0.0, glue set - 53.87376fil
+...\kern 0.0
+...\kern 54.8775
+...\kern -1.00374
+...\pdfdest name{page.1} xyz
+...\penalty 10000
+...\glue 0.0 plus 1.0fil minus 1.0fil
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\glue(\lineskip) 0.0
+.\vbox(640.215+0.0)x414.8775
+..\glue 22.215
+..\vbox(618.0+0.0)x360.0, shifted 54.8775
+...\vbox(8.0+0.0)x360.0, glue set 8.0fil
+....\glue 0.0 plus 1.0fil
+....\hbox(0.0+0.0)x360.0
+.....\hbox(0.0+0.0)x360.0
+...\glue 14.0
+...\glue(\lineskip) 0.0
+...\vbox(584.0+0.0)x360.0, glue set 556.0fil
+....\pdfdest name{Doc-Start} xyz
+....\write1{\newlabel{t:a}{{1}{\thepage }{}{thmx.1}{}}}
+....\glue(\topskip) 3.05556
+....\hbox(6.94444+0.0)x360.0, glue set 292.11142fil
+.....\penalty 10000
+.....\hbox(0.0+0.0)x0.0
+......\hbox(0.0+0.0)x0.0, shifted -12.0
+.......\pdfdest name{thmx.1} xyz
+.......\penalty 10000
+.....\OT1/cmr/bx/n/10 T
+.....\OT1/cmr/bx/n/10 h
+.....\OT1/cmr/bx/n/10 e
+.....\OT1/cmr/bx/n/10 o
+.....\OT1/cmr/bx/n/10 r
+.....\OT1/cmr/bx/n/10 e
+.....\OT1/cmr/bx/n/10 m
+.....\kern 0.0
+.....\glue 3.83331 plus 1.91666 minus 1.27777
+.....\OT1/cmr/bx/n/10 1
+.....\kern 0.0
+.....\OT1/cmr/bx/n/10 .
+.....\glue 5.0 plus 1.0 minus 1.0
+.....\OT1/cmr/m/it/10 a
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\penalty -51
+....\glue 6.0 plus 2.39996 minus 2.39996
+....\glue(\parskip) 0.0
+....\glue(\parskip) 0.0
+....\glue(\baselineskip) 5.16669
+....\hbox(6.83331+1.94444)x360.0, glue set 327.3055fil
+.....\hbox(0.0+0.0)x12.0
+.....\OT1/cmr/m/n/10 B
+.....\OT1/cmr/m/n/10 y
+.....\glue 3.33333 plus 1.66666 minus 1.11111
+.....\pdfstartlink(*+*)x* attr{/Border[0 0 1]/H/I/C[1 0 0]} action goto name{thmx.1}
+.....\OT1/cmr/m/n/10 1
+.....\pdfendlink
+.....\penalty 10000
+.....\glue(\parfillskip) 0.0 plus 1.0fil
+.....\glue(\rightskip) 0.0
+....\glue -1.94444
+....\glue 0.0 plus 1.0fil
+....\glue 0.0
+...\glue(\baselineskip) 7.48889
+...\hbox(4.51111+0.0)x360.0
+....\hbox(4.51111+0.0)x360.0, glue set 178.00694fil
+.....\glue 0.0 plus 1.0fil
+.....\OT1/cmr/m/n/7 1
+.....\glue 0.0 plus 1.0fil
+.\kern 0.0
+(thm-006-gh304.aux)
+Package rerunfilecheck Info: File `thm-006-gh304.out' has not changed.
+(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.





More information about the latex3-commits mailing list.