summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/zref
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-05 03:00:59 +0000
committerNorbert Preining <norbert@preining.info>2020-03-05 03:00:59 +0000
commit898048513951b471a492afa23e46112d14bcb236 (patch)
tree8596afc705f55d2d07b324a756f7283ac0e2d21b /macros/latex/contrib/zref
parent19d25b8009801aa98ea2f46b45c37c257f990491 (diff)
CTAN sync 202003050300
Diffstat (limited to 'macros/latex/contrib/zref')
-rw-r--r--macros/latex/contrib/zref/zref.dtx564
-rw-r--r--macros/latex/contrib/zref/zref.pdfbin686493 -> 671033 bytes
2 files changed, 217 insertions, 347 deletions
diff --git a/macros/latex/contrib/zref/zref.dtx b/macros/latex/contrib/zref/zref.dtx
index c1c76e7210..d7a5b0863e 100644
--- a/macros/latex/contrib/zref/zref.dtx
+++ b/macros/latex/contrib/zref/zref.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% File: zref.dtx
-% Version: 2019/11/29 v2.28
+% Version: 2020-03-03 v2.29
% Info: A new reference scheme for LaTeX
%
% Copyright (C)
@@ -95,10 +95,6 @@
% TDS:doc/latex/zref/zref-example.tex
% TDS:doc/latex/zref/zref-example-lastpage.tex
% TDS:doc/latex/zref/zref-example-nextpage.tex
-% TDS:doc/latex/zref/test/zref-test1.tex
-% TDS:doc/latex/zref/test/zref-test-base.tex
-% TDS:doc/latex/zref/test/zref-test-runs.tex
-% TDS:doc/latex/zref/test/zref-test-titleref-memoir.tex
% TDS:source/latex/zref/zref.dtx
%
%<*ignore>
@@ -116,7 +112,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: zref 2019/11/29 v2.28 A new reference scheme for LaTeX (HO)}
+\Msg{* Package: zref 2020-03-03 v2.29 A new reference scheme for LaTeX (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -128,11 +124,11 @@
This is a generated file.
Project: zref
-Version: 2019/11/29 v2.28
+Version: 2020-03-03 v2.29
Copyright (C)
2006-2012 Heiko Oberdiek
- 2016-2019 Oberdiek Package Support Group
+ 2016-2020 Oberdiek Package Support Group
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
@@ -202,10 +198,6 @@ and the derived files
% \file{zref-test-base.tex}{\from{zref.dtx}{test-base}}%
% \file{zref-test-runs.tex}{\from{zref.dtx}{test-runs}}%
% \file{zref-test-titleref-memoir.tex}{\from{zref.dtx}{test-titleref-memoir}}%
- \nopreamble
- \nopostamble
-% \usedir{source/latex/zref/catalogue}%
-% \file{zref.xml}{\from{zref.dtx}{catalogue}}%
}
\catcode32=13\relax% active space
@@ -238,7 +230,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{zref.drv}%
- [2019/11/29 v2.28 A new reference scheme for LaTeX (HO)]%
+ [2020-03-03 v2.29 A new reference scheme for LaTeX (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}[2011/11/22]
\setlength{\emergencystretch}{1em}
@@ -249,26 +241,11 @@ and the derived files
% \fi
%
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
%
% \GetFileInfo{zref.drv}
%
% \title{The \xpackage{zref} package}
-% \date{2019/11/29 v2.28}
+% \date{2020-03-03 v2.29}
% \author{Heiko Oberdiek\thanks
% {Please report any issues at \url{https://github.com/ho-tex/zref/issues}}}
%
@@ -878,6 +855,10 @@ and the derived files
%
% With the help of package \xpackage{atbegshi}
% a new counter |abspage| with absolute page numbers is provided.
+% For technical and historical reasons the counter itself is zero based:
+% if you use it directly on the first page, e.g
+% with |\arabic{abspage}| you will get 0 as value. When using |\zref|
+% the first page will be page 1 as expected.
% Also a new property |abspage| is defined and added to the
% main property list. Thus you can reference the absolute
% page number:
@@ -1339,6 +1320,46 @@ and the derived files
% The property list |savepos| contains the properties |posx|
% and |posy|.
%
+% \subsection{Module \xmodule{abspos}}
+% Module \xmodule{abspos} allows to get various values of the page layout. There is no user
+% command, only a number of internal commands. For example:
+% \begin{quote}
+% |\zref@absposx{|\meta{label}|}{|\meta{value}|}{|\meta{position}|}|\\
+% |\zref@absposy{|\meta{label}|}{|\meta{value}|}{|\meta{position}|}|
+% \end{quote}
+%
+% The return value is like in the module \xmodule{savepos} a number representing a length in sp.
+% The length are measured from the bottom left of the page.
+%
+% \meta{label} is a label set with \cs{zlabel} or \cs{zsavepos} that allows to retrieve the
+% absolute page number.
+%
+% \meta{position} is for the x-command one of |left|, |right| or |center|. For the y-command
+% it is one of |top|, |bottom|, |center|.
+%
+% The possible content of \meta{value} can be seen in the following table. Be aware that the code
+% makes some assumptions which are perhaps not always true -- for example that the left of
+% the head is identical to the left of the body.
+%
+% \medskip
+% \begin{tabular}{lll}
+% \textbf{value} & \textbf{axis} & \textbf{comments}\\\hline
+% media & x & left=0, right=\cs{pdfpagewidth} \\
+% paper & x & left=0, right=\cs{paperwidth}\\
+% stock & x & derived from paper\\
+% media & y & bottom=0, top=\cs{pdfpageheigh}\\
+% paper & y & top=\cs{pdfpageheight}, bottom=top-\cs{paperheight}\\
+% stock & y & top derived from paper\\
+% head & x & calculated with hoffset, horigin, etc\\
+% head & y & calculated\\
+% body & x & = head value\\%
+% body & y & = head bottom - \cs{headsep}\\
+% foot & x & = head\\
+% foot & y & calculated from body bottom and \cs{footskip}\\
+% marginpar & x &different on odd/even pages! \\
+% marginpar & y & = body %
+% \end{tabular}
+%
% \subsection{Module \xmodule{dotfill}}
%
% \begin{declcs}{zdotfill}
@@ -1433,6 +1454,17 @@ and the derived files
% this macro as extension. \cs{XR@ext} is used if
% \xpackage{hyperref} is loaded, otherwise |pdf|.
%
+% \subsection{Module \xmodule{pageattr}}
+%
+% This module allows to recover the content of the register
+% \cs{pdfpageattr} and \cs{pdfpagesattr} in pdftex and the equivalent register
+% in luatex. There is no user command. Programmer commands are
+%
+% \begin{quote}
+% |\zref@pdfpageattr{|\meta{absolute page number}|}|
+%
+% |\zref@pdfpagesattr{|\meta{absolute page number}|}|
+% \end{quote}
% \section{ToDo}\label{sec:todo}
%
% Among other things the following issues are left for future work:
@@ -1631,7 +1663,7 @@ the height difference of the two baselines is
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref}
- [2019/11/29 v2.28 A new reference scheme for LaTeX (HO)]%
+ [2020-03-03 v2.29 A new reference scheme for LaTeX (HO)]%
% \end{macrocode}
%
% \subsubsection{Load basic module}
@@ -1718,7 +1750,7 @@ the height difference of the two baselines is
%<*base>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-base}%
- [2019/11/29 v2.28 Module base for zref (HO)]%
+ [2020-03-03 v2.29 Module base for zref (HO)]%
% \end{macrocode}
%
% \subsubsection{Utilities}
@@ -3025,7 +3057,7 @@ the height difference of the two baselines is
%<*user>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-user}%
- [2019/11/29 v2.28 Module user for zref (HO)]%
+ [2020-03-03 v2.29 Module user for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3116,7 +3148,7 @@ the height difference of the two baselines is
%<*abspage>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-abspage}%
- [2019/11/29 v2.28 Module abspage for zref (HO)]%
+ [2020-03-03 v2.29 Module abspage for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3164,7 +3196,7 @@ the height difference of the two baselines is
%<*counter>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-counter}%
- [2019/11/29 v2.28 Module counter for zref (HO)]%
+ [2020-03-03 v2.29 Module counter for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3204,7 +3236,7 @@ the height difference of the two baselines is
%<*lastpage>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-lastpage}%
- [2019/11/29 v2.28 Module lastpage for zref (HO)]%
+ [2020-03-03 v2.29 Module lastpage for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\RequirePackage{zref-abspage}[2019/11/29]
\RequirePackage{atveryend}[2009/12/07]
@@ -3276,7 +3308,7 @@ the height difference of the two baselines is
%<*thepage>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-thepage}%
- [2019/11/29 v2.28 Module thepage for zref (HO)]%
+ [2020-03-03 v2.29 Module thepage for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3351,7 +3383,7 @@ the height difference of the two baselines is
%<*nextpage>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-nextpage}%
- [2019/11/29 v2.28 Module nextpage for zref (HO)]%
+ [2020-03-03 v2.29 Module nextpage for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3455,7 +3487,7 @@ the height difference of the two baselines is
%<*totpages>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-totpages}%
- [2019/11/29 v2.28 Module totpages for zref (HO)]%
+ [2020-03-03 v2.29 Module totpages for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3497,7 +3529,7 @@ the height difference of the two baselines is
%<*pagelayout>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-pagelayout}%
- [2019/11/29 v2.28 Module pagelayout for zref (HO)]%
+ [2020-03-03 v2.29 Module pagelayout for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3511,39 +3543,6 @@ the height difference of the two baselines is
\RequirePackage{atveryend}[2010/03/24]
% \end{macrocode}
%
-% \subsubsection{Support for \hologo{LuaTeX}}
-%
-% \begin{macrocode}
-\ifluatex
- \ifnum\luatexversion<39 %
- \else
- \begingroup
- \escapechar=-1 %
- \def\ZREF@temp#1{%
- \ltx@IfUndefined{\string#1}{%
- \let#1\ltx@undefined
- \directlua{%
- if tex.enableprimitives then %
- tex.enableprimitives('', {'\string#1'})%
- end%
- }%
- \ltx@ifundefined{\string#1}{%
- }{%
- \global#1=#1%
- \@PackageInfoNoLine{zref-pagelayout}{%
- \string#1 enabled%
- }%
- }%
- }{}%
- }%
- \ZREF@temp\pdfpagewidth
- \ZREF@temp\pdfpageheight
- \ZREF@temp\pdfhorigin
- \ZREF@temp\pdfvorigin
- \endgroup
- \fi
-\fi
-% \end{macrocode}
%
% \subsubsection{Define layout properties}
%
@@ -3569,10 +3568,29 @@ the height difference of the two baselines is
\ZREF@temp\stockheight % memoir.cls, crop.sty
\ZREF@temp\mediawidth % VTeX
\ZREF@temp\mediaheight % VTeX
+\ifluatex
+\zref@newprop*{pdfvorigin}%
+ [\number\pdfvariable vorigin]% hash-ok
+ {\number\pdfvariable vorigin}%
+\zref@addprop{thepage}{pdfvorigin}
+\zref@newprop*{pdfhorigin}%
+ [\number\pdfvariable horigin]% hash-ok
+ {\number\pdfvariable horigin}%
+\zref@addprop{thepage}{pdfhorigin}
+\zref@newprop*{pdfpageheight}%
+ [\number\pageheight]% hash-ok
+ {\number\pageheight}%
+\zref@addprop{thepage}{pdfpageheight}
+\zref@newprop*{pdfpagewidth}%
+ [\number\pagewidth]% hash-ok
+ {\number\pagewidth}%
+\zref@addprop{thepage}{pdfpagewidth}
+\else
\ZREF@temp\pdfpagewidth
\ZREF@temp\pdfpageheight
\ZREF@temp\pdfhorigin
\ZREF@temp\pdfvorigin
+\fi
\ZREF@temp\hoffset
\ZREF@temp\voffset
\ZREF@temp\topmargin
@@ -3739,7 +3757,7 @@ the height difference of the two baselines is
%<*pageattr>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-pageattr}%
- [2019/11/29 v2.28 Module pageattr for zref (HO)]%
+ [2020-03-03 v2.29 Module pageattr for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -3751,61 +3769,48 @@ the height difference of the two baselines is
\RequirePackage{iftex}[2019/11/07]%
% \end{macrocode}
%
-% \begin{macrocode}
-\ifluatex
- \ifnum\luatexversion<39 %
- \else
- \begingroup
- \escapechar=-1 %
- \def\ZREF@temp#1{%
- \ltx@IfUndefined{\string#1}{%
- \let#1\ltx@undefined
- \directlua{%
- if tex.enableprimitives then %
- tex.enableprimitives('', {'\string#1'})%
- end%
- }%
- \ltx@ifundefined{\string#1}{%
- }{%
- \global#1=#1%
- \@PackageInfoNoLine{zref-pageattr}{%
- \string#1 enabled%
- }%
- }%
- }{}%
- }%
- \ZREF@temp\pdfpageattr
- \ZREF@temp\pdfpagesattr
- \endgroup
- \fi
-\fi
-% \end{macrocode}
%
% \begin{macrocode}
\let\ZREF@temp=N%
-\ltx@IfUndefined{pdfpageattr}{%
+\ifluatex
+\expandafter\@firstoftwo
+\else
+\expandafter\@secondoftwo
+\fi
+{%luatex
+ \RequirePackage{zref-thepage}[2019/11/29]
+ \RequirePackage{zref-lastpage}[2019/11/29]%
+ \zref@newprop*{pdfpageattr}[]{\zref@hex{\the\pdfvariable pageattr}}%
+ \zref@addprop{thepage}{pdfpageattr}%
+ \zref@newprop*{pdfpagesattr}[]{\zref@hex{\the\pdfvariable pagesattr}}%
+ \zref@addprop{LastPage}{pdfpagesattr}%
+ \let\ZREF@temp=Y%
+}
+{%other
+ \ltx@IfUndefined{pdfpageattr}{%
\@PackageInfoNoLine{zref-pageattr}{%
\string\pdfpageattr\space is not available%
}%
\def\zref@pdfpageattr#1{}%
\def\zref@pdfpageattr@used#1{}%
-}{%
+ }{%
\RequirePackage{zref-thepage}[2019/11/29]%
\zref@newprop*{pdfpageattr}[]{\zref@hex{\the\pdfpageattr}}%
\zref@addprop{thepage}{pdfpageattr}%
\let\ZREF@temp=Y%
-}
-\ltx@IfUndefined{pdfpagesattr}{%
+ }
+ \ltx@IfUndefined{pdfpagesattr}{%
\@PackageInfoNoLine{zref-pageattr}{%
\string\pdfpagesattr\space is not available%
}%
\def\zref@pdfpagesattr{}%
\def\zref@pdfpagesattr@used{}%
-}{%
+ }{%
\RequirePackage{zref-lastpage}[2019/11/29]%
\zref@newprop*{pdfpagesattr}[]{\zref@hex{\the\pdfpagesattr}}%
\zref@addprop{LastPage}{pdfpagesattr}%
\let\ZREF@temp=Y%
+ }%
}%
% \end{macrocode}
% \begin{macrocode}
@@ -3863,12 +3868,23 @@ the height difference of the two baselines is
% \end{macro}
% \begin{macro}{\ZREF@pa@AtVeryEnd}
% \begin{macrocode}
-\ltx@IfUndefined{pdfpageattr}{%
+\let\ZREF@temp=Y%
+\ltx@IfUndefined{pdfpageattr}{}{\let\ZREF@temp=N}
+\ifluatex \let\ZREF@temp=N \fi
+\ifx\ZREF@temp Y
+ \expandafter\@firstoftwo
+\else
+ \expandafter\@secondoftwo
+\fi
+ {%
\def\ZREF@pa@AtVeryEnd{}%
-}{%
+ }
+ {%
\def\ZREF@pa@AtVeryEnd{%
\begingroup
- \toks@{List of \ltx@backslashchar pdfpageattr:\MessageBreak}%
+ \toks@{List of \ltx@backslashchar
+ \ifluatex pdfvariable\else pdf\fi
+ pdfpageattr:\MessageBreak}%
\count@=1 %
\ZREF@pa@ListPage
\edef\x{\endgroup
@@ -3882,11 +3898,13 @@ the height difference of the two baselines is
% \end{macro}
% \begin{macro}{\zref@pageattr}
% \begin{macrocode}
-\def\zref@pageattr#1{%
+\def\zref@pdfpageattr#1{%
\zref@unhex{%
\zref@extract{thepage\ZREF@number{#1}}{pdfpageattr}%
}%
}
+% compability, \zref@pageattr was defined in older versions
+\let\zref@pageattr\zref@pdfpageattr
% \end{macrocode}
% \end{macro}
% \begin{macro}{\zref@pageattr@used}
@@ -3921,8 +3939,13 @@ the height difference of the two baselines is
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
-\ltx@IfUndefined{pdfpagesattr}{%
-}{%
+\let\ZREF@temp=Y%
+\ltx@IfUndefined{pdfpagesattr}{}{\let\ZREF@temp=N}
+\ifluatex \let\ZREF@temp=N \fi
+\ifx\ZREF@temp N
+ \expandafter\@firstofone
+\fi
+ {%
% \end{macrocode}
% \begin{macro}{\zref@pdfpagesattr}
% \begin{macrocode}
@@ -3943,7 +3966,9 @@ the height difference of the two baselines is
% \begin{macrocode}
\ltx@LocalAppendToMacro\ZREF@pa@AtVeryEnd{%
\@PackageInfoNoLine{zref-pageattr}{%
- \ltx@backslashchar pdfpagesattr:\MessageBreak
+ \ltx@backslashchar
+ \ifluatex pdfvariable\else pdf\fi
+ pagesattr:\MessageBreak
<<\zref@pdfpagesattr>>%
\MessageBreak
}%
@@ -3964,7 +3989,7 @@ the height difference of the two baselines is
%<*marks>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-marks}%
- [2019/11/29 v2.28 Module marks for zref (HO)]%
+ [2020-03-03 v2.29 Module marks for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -4070,7 +4095,7 @@ the height difference of the two baselines is
%<*runs>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-runs}%
- [2019/11/29 v2.28 Module runs for zref (HO)]%
+ [2020-03-03 v2.29 Module runs for zref (HO)]%
% \end{macrocode}
%
% \begin{macro}{\zruns}
@@ -4102,7 +4127,7 @@ the height difference of the two baselines is
%<*perpage>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-perpage}%
- [2019/11/29 v2.28 Module perpage for zref (HO)]%
+ [2020-03-03 v2.29 Module perpage for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -4284,7 +4309,7 @@ the height difference of the two baselines is
%<*titleref>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-titleref}%
- [2019/11/29 v2.28 Module titleref for zref (HO)]%
+ [2020-03-03 v2.29 Module titleref for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -4697,7 +4722,7 @@ the height difference of the two baselines is
%<*xr>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-xr}%
- [2019/11/29 v2.28 Module xr for zref (HO)]%
+ [2020-03-03 v2.29 Module xr for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -5233,7 +5258,7 @@ the height difference of the two baselines is
%<*hyperref>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-hyperref}%
- [2019/11/29 v2.28 Module hyperref for zref (HO)]%
+ [2020-03-03 v2.29 Module hyperref for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -5263,26 +5288,19 @@ the height difference of the two baselines is
%<*savepos>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-savepos}%
- [2019/11/29 v2.28 Module savepos for zref (HO)]%
+ [2020-03-03 v2.29 Module savepos for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
\expandafter\endinput
\fi
% \end{macrocode}
-% LuaTeX compatibility
-% \begin{macrocode}
-\ifx\pdfsavepos\@undefined
- \let\pdfsavepos \savepos
- \let\pdflastxpos \lastxpos
- \let\pdflastypos \lastypos
-\fi
-% \end{macrocode}
%
% \subsubsection{Availability}
%
% First we check, whether the feature is available.
% \begin{macrocode}
+\ifx\directlua\@undefined
\ltx@IfUndefined{pdfsavepos}{%
\PackageError\ZREF@name{%
\string\pdfsavepos\space is not supported.\MessageBreak
@@ -5290,13 +5308,13 @@ the height difference of the two baselines is
}\ZREF@UpdatePdfTeX
\endinput
}{}%
+\fi
% \end{macrocode}
% In PDF mode we are done. However support for DVI mode
% was added later in version 1.40.0. In earlier versions
% \cs{pdfsavepos} is defined, but its execution raises
% an error. Note that \hologo{XeTeX} also provides \cs{pdfsavepos}.
% \begin{macrocode}
-\RequirePackage{ifpdf}
\ifpdf
\else
\ltx@IfUndefined{pdftexversion}{%
@@ -5317,8 +5335,13 @@ the height difference of the two baselines is
%
% \begin{macrocode}
\zref@newlist{savepos}
-\zref@newprop*{posx}[0]{\the\pdflastxpos}
-\zref@newprop*{posy}[0]{\the\pdflastypos}
+\ifx\directlua\@undefined
+ \zref@newprop*{posx}[0]{\the\pdflastxpos}
+ \zref@newprop*{posy}[0]{\the\pdflastypos}
+\else
+ \zref@newprop*{posx}[0]{\the\lastxpos}
+ \zref@newprop*{posy}[0]{\the\lastypos}
+\fi
\zref@addprops{savepos}{posx,posy}
% \end{macrocode}
%
@@ -5326,11 +5349,19 @@ the height difference of the two baselines is
%
% \begin{macro}{\zref@savepos}
% \begin{macrocode}
-\def\zref@savepos{%
- \if@filesw
- \pdfsavepos
- \fi
-}
+\ifx\directlua\@undefined
+ \def\zref@savepos{%
+ \if@filesw
+ \pdfsavepos
+ \fi
+ }
+\else
+ \def\zref@savepos{%
+ \if@filesw
+ \savepos
+ \fi
+ }
+\fi
% \end{macrocode}
% \end{macro}
%
@@ -5430,7 +5461,7 @@ the height difference of the two baselines is
%<*abspos>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-abspos}%
- [2019/11/29 v2.28 Module abspos for zref (HO)]%
+ [2020-03-03 v2.29 Module abspos for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -5450,10 +5481,6 @@ the height difference of the two baselines is
\zref@addprop{savepos}{abspage}
% \end{macrocode}
%
-% \begin{macrocode}
-\RequirePackage{ifpdf}[2010/09/13]
-% \end{macrocode}
-%
% \begin{macro}{\zref@absposx}
% \begin{macrocode}
\newcommand*{\zref@absposx}[3]{%
@@ -5655,6 +5682,9 @@ the height difference of the two baselines is
pdfpagewidth%
}%
}
+\ifluatex
+\def\ZREF@abspos@media@width{pdfpagewidth}%
+\fi
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ZREF@abspos@media@height}
@@ -5682,6 +5712,18 @@ the height difference of the two baselines is
\noexpand\fi
}%
}
+\ifluatex
+\edef\ZREF@abspos@media@height{%
+ \noexpand\ifcase\pageheight
+ \ltx@ifundefined{stockheight}{%
+ paperheight%
+ }{%
+ stockheight%
+ }%
+ \noexpand\else
+ pdfpageheight%
+ \noexpand\fi}%
+\fi
% \end{macrocode}
% \end{macro}
%
@@ -5778,14 +5820,22 @@ the height difference of the two baselines is
%
% \subsubsection{Origin}
%
+% There doesn't seem a good reason to make these tests depend on pdf mode
+% in current engines, so comment out the \verb|\ifpdf| tests.
% \begin{macro}{\ZREF@abspos@origin@x}
% \begin{macrocode}
\let\ZREF@temp\ltx@two
\ltx@IfUndefined{pdfhorigin}{}{%
- \ifpdf
+% \ifpdf
\let\ZREF@temp\ltx@zero
- \fi
+% \fi
}
+\ifluatex
+% \ifpdf
+ \let\ZREF@temp\ltx@zero
+% \fi
+\fi
+
\ifx\ZREF@temp\ltx@two
\ifnum\mag=1000 %
\let\ZREF@temp\ltx@one
@@ -5810,10 +5860,15 @@ the height difference of the two baselines is
% \begin{macrocode}
\let\ZREF@temp\ltx@two
\ltx@IfUndefined{pdfvorigin}{}{%
- \ifpdf
+% \ifpdf
\let\ZREF@temp\ltx@zero
- \fi
+% \fi
}
+\ifluatex
+% \ifpdf
+ \let\ZREF@temp\ltx@zero
+% \fi
+\fi
\ifx\ZREF@temp\ltx@two
\ifnum\mag=1000 %
\let\ZREF@temp\ltx@one
@@ -6059,7 +6114,7 @@ the height difference of the two baselines is
%<*dotfill>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-dotfill}%
- [2019/11/29 v2.28 Module dotfill for zref (HO)]%
+ [2020-03-03 v2.29 Module dotfill for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -6159,7 +6214,7 @@ the height difference of the two baselines is
%<*env>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-env}%
- [2019/11/29 v2.28 Module env for zref (HO)]%
+ [2020-03-03 v2.29 Module env for zref (HO)]%
\RequirePackage{zref-base}[2019/11/29]
\ifx\ZREF@base@ok Y%
\else
@@ -6195,201 +6250,7 @@ the height difference of the two baselines is
%</env>
% \end{macrocode}
%
-%
-% \section{Test}
-%
-% \subsection{\cs{zref@localaddprop}}
-%
-% \begin{macrocode}
-%<*test1>
-\NeedsTeXFormat{LaTeX2e}
-\nofiles
-\documentclass{article}
-\usepackage{zref-base}[2019/11/29]
-\usepackage{qstest}
-\IncludeTests{*}
-\LogTests{log}{*}{*}
-
-\makeatletter
-\def\ExpectList#1#2{%
- \expandafter\expandafter\expandafter\Expect
- \expandafter\expandafter\expandafter{\csname Z@L@#1\endcsname}{#2}%
-}
-\begin{qstest}{localaddprop}{localaddprop}
- \ExpectList{main}{\default\page}%
- \Expect{undefined}*{\meaning\foobar}%
- \zref@newprop{foobar}{FOO}%
- \Expect{undefined}*{\meaning\foobar}%
- \zref@newlist{alist}%
- \ExpectList{alist}{}%
- \begingroup
- \zref@localaddprop{main}{foobar}%
- \Expect{undefined}*{\meaning\foobar}%
- \ExpectList{main}{\default\page\foobar}%
- \zref@localaddprop{alist}{page}%
- \ExpectList{alist}{\page}%
- \endgroup
- \ExpectList{main}{\default\page}%
- \ExpectList{alist}{}%
- \zref@addprop{alist}{foobar}%
- \ExpectList{alist}{\foobar}%
- \Expect{undefined}*{\meaning\foobar}%
-\end{qstest}
-\@@end
-%</test1>
-% \end{macrocode}
-%
-% \subsection{Module \xmodule{base}}
-%
-% \begin{macrocode}
-%<*test-base>
-\NeedsTeXFormat{LaTeX2e}
-\documentclass{article}
-\usepackage{zref-base,zref-titleref}[2019/11/29]
-\usepackage{qstest}
-\IncludeTests{*}
-\LogTests{log}{*}{*}
-
-\makeatletter
-\newcommand*{\DefExpand}[2]{%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter#1%
- \expandafter\expandafter\expandafter{#2}%
- \@onelevel@sanitize#1%
-}
-\newcommand*{\Test}[3]{%
- \Expect{#2}*{#1}%
- \zref@wrapper@unexpanded{%
- \Expect*{#3}*{#1}%
- }%
- \DefExpand\x{#1}%
- \Expect*{#3}*{\x}%
-}
-\makeatother
-
-\begin{document}
-\section{\textit{Hello} \textbf{World}}
-\label{sec:hello}
-\makeatletter
-\zref@newprop{foo}[\@empty D\@empty efault]{\@empty V\@empty alue}
-\begin{qstest}{getcurrent}{getcurrent}
- \Test{\zref@getcurrent{foo}}%
- {Value}{\noexpand\@empty V\noexpand\@empty alue}%
- \Test{\zref@getcurrent{xy}}{}{}%
-\end{qstest}
-\begin{qstest}{extract}{extract}
- \def\textbf#1{<#1>}%
- \def\textit#1{[#1]}% hash-ok
- \Test{\zref@extractdefault{xy}{page}{\@empty D\@empty efault}}%
- {Default}{\noexpand\@empty D\noexpand\@empty efault}%
- \Test{\zref@extractdefault{sec:hello}{foo}{\@empty A\@empty B}}%
- {AB}{\noexpand\@empty A\noexpand\@empty B}%
- \Test{\zref@extract{sec:hello}{foo}}%
- {Default}{\noexpand\@empty D\noexpand\@empty efault}%
- \zref@ifrefundefined{sec:hello}{%
- }{%
- \Test{\zref@extract{sec:hello}{default}}{1}{1}%
- \Test{\zref@extract{sec:hello}{title}}%
- {[Hello] <World>}%
- {\noexpand\textit{Hello} \noexpand\textbf{World}}%
- }%
-\end{qstest}
-\end{document}
-%</test-base>
-% \end{macrocode}
-%
-% \subsection{Module \xmodule{runs}}
-%
-% \begin{macrocode}
-%<*test-runs>
-\NeedsTeXFormat{LaTeX2e}
-\documentclass{article}
-\usepackage{zref-runs}[2019/11/29]
-\usepackage{qstest}
-\IncludeTests{*}
-\LogTests{log}{*}{*}
-
-\begin{qstest}{zruns-preamble}{zruns-preamble}
- \Expect{0}*{\zruns}%
-\end{qstest}
-
-\AtBeginDocument{%
- \begin{qstest}{zruns-atbegindocument}{zruns-atbegindocument}%
- \Expect*{\number\ExpectRuns}*{\zruns}%
- \end{qstest}%
-}
-
-\begin{document}
-\begin{qstest}{zruns-document}{zruns-document}
- \Expect*{\number\ExpectRuns}*{\zruns}%
-\end{qstest}
-\end{document}
-%</test-runs>
-% \end{macrocode}
-%
-% \subsection{Module \xmodule{titleref}}
-%
-% \begin{macrocode}
-%<*test-titleref-memoir>
-\NeedsTeXFormat{LaTeX2e}
-\documentclass{memoir}
-\usepackage{zref-titleref}[2019/11/29]
-\usepackage{qstest}
-\IncludeTests{*}
-\LogTests{log}{*}{*}
-\begin{document}
-\makeatletter
-\def\List{}
-\def\Label#1{%
- \zref@label{#1}%
- \g@addto@macro\List{%
- \par
- #1: [\ztitleref{#1}]%
- }%
- \mbox{}%
- \zref@refused{#1}%
- \zref@ifrefundefined{#1}{%
- }{%
- \begingroup
- \edef\x{\zref@extract{#1}{title}}%
- \Expect{OK/}*{\expandafter\ltx@carthree\x{}{}{}\@nil}%
- \endgroup
- }%
-}
-\def\Test#1{%
- \csname#1\endcsname*{OK/#1}%
- \Label{#1*}%
- \csname#1\endcsname{OK/#1}%
- \Label{#1}%
- \csname#1\endcsname[OK/#1-toc]%
- {WRONG-in-titleref/#1-toc-2}%
- \Label{#1-toc}%
- \expandafter\ifx\csname#1\endcsname\part
- \else
- \headnamereffalse
- \csname#1\endcsname[OK/#1-th-toc]%
- [WRONG-in-titleref/#1-th-toc-2]%
- {WRONG-in-titleref/#1-th-toc-3}%
- \Label{#1-th-toc}%
- \headnamereftrue
- \csname#1\endcsname[WRONG-in-titleref/#1-th-head-1]%
- [OK/#1-th-head]%
- {WRONG-in-titleref/#1-th-head-3}%
- \Label{#1-th-head}%
- \fi
-}
-\begin{qstest}{section}{section}
- \@for\x:=part,chapter,section,subsection,subsubsection\do{%
- \expandafter\Test\expandafter{\x}%
- }%
-\end{qstest}
-\newpage
-\List
-\end{document}
-%</test-titleref-memoir>
-% \end{macrocode}
-%
-% \section{Installation}
+%% \section{Installation}
%
% \subsection{Download}
%
@@ -6462,10 +6323,6 @@ the height difference of the two baselines is
% zref-example.tex & doc/latex/zref/zref-example.tex\\
% zref-example-lastpage.tex & doc/latex/zref/zref-example-lastpage.tex\\
% zref-example-nextpage.tex & doc/latex/zref/zref-example-nextpage.tex\\
-% test/zref-test1.tex & doc/latex/zref/test/zref-test1.tex\\
-% test/zref-test-base.tex & doc/latex/zref/test/zref-test-base.tex\\
-% test/zref-test-runs.tex & doc/latex/zref/test/zref-test-runs.tex\\
-% test/zref-test-titleref-memoir.tex & doc/latex/zref/test/zref-test-titleref-memoir.tex\\
% zref.dtx & source/latex/zref/zref.dtx\\
% \end{tabular}^^A
% }^^A
@@ -6865,6 +6722,19 @@ the height difference of the two baselines is
% \item
% Use \xpackage{iftex} directly.
% \end{Version}
+% \begin{Version}{2020-03-03 v2.29}
+% \item
+% adapted in module zref-pagelayout the properties pdfhorigin, pdfvorigin,
+% pdfpagewidth, pdfpageheight for luatex to the right primitives.
+% \item
+% Removed no longer needed code for older lualatex versions.
+% \item added some documentation of the abspos module.
+% \item adapted the abspos module to the new luatex primitives.
+% \item adapted pageattr module to the new luatex primitives.
+% \item added short documentation for pageattr module
+% \item use luatex command names directly in zref-savepos rather than defining pdftex compatibility names.
+% \item allow zref-abspos to use \verb|\pdf[vh]origin| in dvi mode.
+% \end{Version}
% \end{History}
%
% \PrintIndex
diff --git a/macros/latex/contrib/zref/zref.pdf b/macros/latex/contrib/zref/zref.pdf
index fee81c695c..79542ad086 100644
--- a/macros/latex/contrib/zref/zref.pdf
+++ b/macros/latex/contrib/zref/zref.pdf
Binary files differ