[latex3-commits] [git/LaTeX3-latex3-pdfresources] test-new-hooks: hook-test (53b2d02)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon May 11 23:01:51 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : test-new-hooks
Link       : https://github.com/latex3/pdfresources/commit/53b2d02c2e9b7560b1f2fa4825ef4d96b7f07fc5

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

commit 53b2d02c2e9b7560b1f2fa4825ef4d96b7f07fc5
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon May 11 23:01:51 2020 +0200

    hook-test


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

53b2d02c2e9b7560b1f2fa4825ef4d96b7f07fc5
 experiments/shipout-hook-test.tex | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/experiments/shipout-hook-test.tex b/experiments/shipout-hook-test.tex
new file mode 100644
index 0000000..a8f7eca
--- /dev/null
+++ b/experiments/shipout-hook-test.tex
@@ -0,0 +1,24 @@
+\RequirePackage{lthooks}
+\documentclass{article}
+\usepackage{zref-user}
+\makeatletter
+\ExplSyntaxOn
+\zref at newprop* {myabspage} [0] { \int_use:N \g_abspage_int }
+\zref at addprop {main} {myabspage}
+
+\int_new:N\g_abspage_int
+\hook_gput_code:nnn{shipout/background}{test}{\put(10,-30){\gdef\blub{back}background: \zlabel{back}\zref[myabspage]{back}}}
+\hook_gput_code:nnn{shipout/before}{test}{\gdef\blub{before}\def\blab{xxx}\int_gincr:N \g_abspage_int}
+\hook_gput_code:nnn{shipout/foreground}{test}{\put(10,-50){foreground: \zlabel{fore}\zref[myabspage]{fore}}}
+\ExplSyntaxOff
+\makeatother
+\begin{document}
+
+\ExplSyntaxOn
+page: \zlabel{page}\zref[myabspage]{page}
+\ExplSyntaxOff
+
+\newpage
+\blub \blab
+
+\end{document}
\ No newline at end of file





More information about the latex3-commits mailing list.