[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: some test files, material (a4dcfaa)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue May 14 16:04:47 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/a4dcfaa0dc1fafa656204d65670862c46d9b9351

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

commit a4dcfaa0dc1fafa656204d65670862c46d9b9351
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue May 14 16:04:47 2019 +0200

    some test files, material


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

a4dcfaa0dc1fafa656204d65670862c46d9b9351
 experiments/atbegshi-tests.tex |  251 ++++++++++++++++++++++++++++++++++++++++
 hyperref-patches.tex           |  163 ++++++++++++++++++++++++++
 test-ocg-properties.tex        |   32 +++++
 3 files changed, 446 insertions(+)

diff --git a/experiments/atbegshi-tests.tex b/experiments/atbegshi-tests.tex
new file mode 100644
index 0000000..4b6b199
--- /dev/null
+++ b/experiments/atbegshi-tests.tex
@@ -0,0 +1,251 @@
+\documentclass{article}
+\usepackage{color}
+\usepackage{expl3}
+\usepackage{l3hooks}
+\usepackage{etoolbox}
+\usepackage{atbegshi}
+\usepackage{picture}
+\usepackage{zref-base,zref-user}
+\robustify\color
+
+\ExplSyntaxOn
+
+\hook_new:n { shipout }
+\int_new:N \g_shipout_page_int
+
+\int_new:N \l__shipout_group_level_int
+\box_new:N \l__shipout_main_box
+
+\cs_new_protected:Npn \__shipout:w
+  {
+    \int_set_eq:NN \l__shipout_group_level_int \tex_currentgrouplevel:D
+    \tex_afterassignment:D \__shipout_auxi:
+    \tex_setbox:D \l__shipout_main_box =
+  }
+\cs_new_protected:Npn \__shipout_auxi:
+  {
+    \int_compare:nNnTF \l__shipout_group_level_int < \tex_currentgrouplevel:D
+      { \group_insert_after:N \__shipout_auxii: }
+      { \__shipout_auxii: }
+  }
+\cs_new_protected:Npn \__shipout_auxii:
+  {
+    \box_if_empty:NTF \l__shipout_main_box
+      { \msg_warning:nn { shipout } { empty-shipout-box } }
+      {
+        \hook_use:n { shipout }
+        \box_if_empty:NF \l__shipout_main_box
+          { \int_gincr:N \g_shipout_page_int
+            \tex_shipout:D \box_use:N \l__shipout_main_box }
+      }
+  }
+\cs_new_protected:Npn \shipout_box_add:nn #1#2
+  {
+    \box_if_horizontal:NTF \l__shipout_main_box
+      { \__shipout_hbox_add:nn }
+      {
+        \box_if_vertical:NTF \l__shipout_main_box
+          { \__shipout_vbox_add:nn }
+          { \use_none:nn }
+      }
+        {#1} {#2}
+  }
+\box_new:N \l__shipout_tmp_box
+\cs_new_protected:Npn \__shipout_hbox_add_bg:nn #1#2
+  {
+    \use:x
+      {
+        \__shipout_hbox_add:nnnn
+          { \int_use:N \tex_hbadness:D }
+          { \dim_use:N tex_hfuzz:D }
+      }
+        {#1} {#2}
+  }
+\cs_new_protected:Npn \__shipout_hbox_add:nnnn #1#2#3#4
+  {
+    \int_set_eq:NN \tex_hbadness:D \c_max_int
+    \dim_set:Nn \tex_hfuzz:D { 1073741823sp }
+    \hbox_set_to_wd:Nnn \l__shipout_main_box
+      { \box_wd:N \l__shipout_main_box }
+      { \use:c { __shipout_hbox_ #3 :nnn } {#1} {#2} {#4} }
+    \int_set:Nn \tex_hbadness:D {#1}
+    \dim_set:Nn \tex_hfuzz:D {#2}
+  }
+\cs_new_protected:Npn \__shipout_hbox_bg:nnn #1#2#3
+  {
+    \hbox_set:Nn \l__shipout_tmp_box
+      {
+        \int_set:Nn \tex_hbadness:D {#1}
+        \dim_set:Nn \tex_hfuzz:D {#2}
+        #3
+      }
+    \__shipout_box_zero_size:N \l__shipout_tmp_box
+    \box_move_up:nn
+      { \box_ht:N \l__shipout_main_box }
+      { \box_use_drop:N \l__shipout_tmp_box }
+    \hbox_unpack_drop:N \l__shipout_main_box
+  }
+\cs_new_protected:Npn \__shipout_hbox_fg:nnn #1#2#3
+  {
+    \hbox_unpack:N \l__shipout_main_box
+    \tex_kern:D -\box_wd:N \l__shipout_main_box
+    \hbox_set:Nn \l__shipout_tmp_box
+      {
+        \int_set:Nn \tex_hbadness:D {#1}
+        \dim_set:Nn \tex_hfuzz:D {#2}
+        #3
+      }
+    \__shipout_box_zero_size:N \l__shipout_tmp_box
+    \box_move_up:nn
+      { \box_ht:N \l__shipout_main_box }
+      { \box_use:N \l__shipout_tmp_box }
+    \tex_kern:D \box_wd:N \l__shipout_main_box
+  }
+\cs_new_protected:Npn \__shipout_vbox_add:nn #1#2
+  {
+    \use:x
+      {
+        \__shipout_vbox_add:nnnnnn
+          { \int_use:N \tex_vbadness:D }
+          { \dim_use:N \tex_vfuzz:D }
+          { \box_ht:N \l__shipout_main_box }
+          { \box_dp:N \l__shipout_main_box }
+      }
+        {#1} {#2}
+  }
+\cs_new_protected:Npn \__shipout_vbox_add:nnnnnn #1#2#3#4#5#6
+  {
+    \int_set_eq:NN \tex_vbadness:D \c_max_int
+    \dim_set:Nn \tex_vfuzz:D { 1073741823sp }
+    \vbox_set_to_ht:Nnn \l__shipout_main_box
+      { \box_ht:N \l__shipout_main_box + \box_dp:N \l__shipout_main_box }
+      { \use:c { __shipout_vbox_ #5 :nnn } {#1} {#2} {#6} }
+    \int_set:Nn \tex_vbadness:D {#1}
+    \dim_set:Nn \tex_vfuzz:D {#2}
+    \box_set_ht:Nn \l__shipout_main_box {#3}
+    \box_set_dp:Nn \l__shipout_main_box {#4}
+  }
+\cs_new_protected:Npn \__shipout_vbox_bg:nnn #1#2#3
+  {
+    \hbox_set:Nn \l__shipout_tmp_box
+      {
+        \int_set:Nn \tex_vbadness:D {#1}
+        \dim_set:Nn \tex_vfuzz:D {#2}
+        #3
+      }
+    \__shipout_box_zero_size:N \l__shipout_tmp_box
+    \dim_zero:N \tex_baselineskip:D
+    \dim_zero:N \tex_lineskip:D
+    \dim_zero:N \tex_lineskiplimit:D
+    \box_use_drop:N \l__shipout_tmp_box
+    \vbox_unpack_drop:N \l__shipout_main_box
+    \tex_kern:D 0pt \scan_stop:
+  }
+\cs_new_protected:Npn \__shipout_vbox_fg:nnn #1#2#3
+  {
+    \hbox_set:Nn \l__shipout_tmp_box
+      {
+        \int_set:Nn \tex_vbadness:D {#1}
+        \dim_set:Nn \tex_vfuzz:D {#2}
+        #3
+      }
+    \__shipout_box_zero_size:N \l__shipout_tmp_box
+    \dim_zero:N \tex_baselineskip:D
+    \dim_zero:N \tex_lineskip:D
+    \dim_zero:N \tex_lineskiplimit:D
+    \vbox_unpack:N \l__shipout_main_box
+    \tex_kern:D
+      \dim_eval:n
+        { - \box_ht:N \l__shipout_main_box - \box_dp:N \l__shipout_main_box }
+        \scan_stop:
+    \box_use_drop:N \l__shipout_tmp_box
+    \tex_kern:D
+      \dim_eval:n
+        { \box_ht:N \l__shipout_main_box + \box_dp:N \l__shipout_main_box }
+        \scan_stop:
+  }
+\cs_new_protected:Npn \__shipout_box_zero_size:N #1
+  {
+    \box_set_wd:Nn #1 { 0pt }
+    \box_set_ht:Nn #1 { 0pt }
+    \box_set_dp:Nn #1 { 0pt }
+  }
+
+\bool_new:N \g__shipout_header_shipped_bool
+
+\cs_new_protected:Npn \shipout_header:n #1
+  {
+    \bool_if:NF \g__shipout_header_shipped_bool
+      {
+        \hook_pre_once:nn { shipout }
+          { \shipout_box_add:nn { fg } {#1} }
+      }
+  }
+\hook_pre_push:nn { shipout }
+  { \bool_gset_true:N \g__shipout_header_shipped_bool }
+
+\cs_new_protected:Npx \__shipout_page_horigin:
+  {
+    \cs_if_exist:NTF \tex_pdfvariable:D
+      { \tex_pdfvariable:D horigin }
+      {
+        \cs_if_exist:NTF \tex_pdfhorigin:D
+          { \tex_pdfhorigin:D }
+          { 72.27pt \scan_stop: }
+      }
+  }
+\cs_new_protected:Npx \__shipout_page_vorigin:
+  {
+    \cs_if_exist:NTF \tex_pdfvariable:D
+      { \tex_pdfvariable:D vorigin }
+      {
+        \cs_if_exist:NTF \tex_pdfvorigin:D
+          { \tex_pdfvorigin:D }
+          { 72.27pt \scan_stop: }
+      }
+  }
+
+\cs_new_protected:Npn \shipout_page_add:nn #1#2
+  {
+    \shipout_box_add:nn {#1}
+      {
+        \tex_kern:D -\__shipout_page_horigin:
+        \vbox_to_zero:n
+          {
+            \tex_kern:D -\__shipout_page_vorigin:
+            \hbox_set:Nn \l__shipout_tmp_box {#2}
+            \__shipout_box_zero_size:N \l__shipout_tmp_box
+            \box_use_drop:N \l__shipout_tmp_box
+            \tex_vss:D
+          }
+      }
+  }
+
+
+\cs_set_eq:NN \shipout \__shipout:w
+\shipout_header:n { \hbox:n { foo } }
+\makeatletter
+\zref at newprop*{kernelabspage}     [0] { \int_use:N \g_shipout_page_int }
+\zref at addprop {main} {kernelabspage}
+\ExplSyntaxOff
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\fancyhead[C]{XXXXXXXXXXXXXXXXXXXXXXXXX}
+\begin{document}
+\zlabel{blub}
+
+\ExplSyntaxOn
+\hook_pre_push:nn { shipout }
+  { \shipout_page_add:nn { fg } { \put(0.5\paperwidth,-0.5\paperheight){\circle{10}}} }
+ \hook_pre_push:nn { shipout }
+  { \shipout_box_add:nn { fg } { \mode_leave_vertical: \color { red } \hbox:n { a } } }
+\hook_pre_push:nn { shipout }
+  { \shipout_box_add:nn { bg } { \mode_leave_vertical: \hbox:n { b } } }
+\ExplSyntaxOff
+
+Hello world
+\newpage
+\pagenumbering{alph}
+blblb\zlabel{test}
+
+\end{document} 
\ No newline at end of file
diff --git a/hyperref-patches.tex b/hyperref-patches.tex
new file mode 100644
index 0000000..f63bf9f
--- /dev/null
+++ b/hyperref-patches.tex
@@ -0,0 +1,163 @@
+\section{stuff that hyperref et all patches}
+\subsection{nameref}
+
+\label to store \@currentlabelname and \@currentHref
+
+\slabel (?) similar
+
+\@writetocindents@ (?)
+
+\@sect, \@ssect: To get the content (\NR at gettitle{#7,}\NR at gettitle{#5}) and to add 
+ \Sectionformat{#8}
+ 
+\@part, \@spart, \@chapter,  
+\M at sect (memoir?) to get the content 
+
+\LT at c@ption: to get the content
+
+\descriptionlabel: to get the content
+
+\ttl at sect@i: (titlesec): to get the content
+
+(beamer): patches section, subsection, subsubsection, theorem begin.
+
+ at opargbegintheorem (?): to get content
+
+(amsthm): \@begintheorem to get the name
+
+\ref, \pageref (if hyperref is loaded) to accomodate to the larger number of arguments of label.
+
+(ifthen):\ifthenelse (for some internal problem ...)
+
+\@@vpageref: adapt to changed \newlabel arguments.
+
+(listings): \lst at MakeCaption: to get the caption contents.
+
+ 
+\subsection{hyperref driver}
+in the driver files
+
+\@ssect: to set an anchor
+
+\@schapter:  to set an anchor
+
+\@chapter
+
+\@part
+
+\@spart
+
+\subsection{hyperref.sty}
+memoir stuff -> memhfixc.sty
+
+subfigure: \sub at label (add \@currentHref to the \newlabel
+
+XR at addURL ??
+
+
+\xspaceaddexceptions{\Hy at xspace@end,\hyper at linkend,\hyper at anchorend}
+needed for new commands too?
+
+\let\texttilde\~% for some languages
+
+\url (to add links)
+
+
+shipout hook: why pdftex different? (finish doc sets info)
+
+\ltx at iffileloaded{hpdftex.def}{%
+  \AtBeginShipout{%
+    \Hy at FirstPageHook
+    \global\let\Hy at FirstPageHook\ltx at empty
+  }%
+}{%
+  \AtBeginShipoutFirst{%
+    \Hy at FirstPageHook
+  }%
+}
+\g at addto@macro\Hy at FirstPageHook{%
+  \PDF at FinishDoc
+  \global\let\PDF at FinishDoc\ltx at empty
+}
+
+
+the following can be stopped with implicit=false
+
+\item (to add number for destination names)
+
+\refstepcounter (to add anchor)
+
+\appendix (to change the H-counter)
+
+(fancyvrb) \FV at StepLineNo to add anchor
+
+(lastpage/revtex4) \lastpage at putlabel (anchor)
+
+(titlesec): \ttl at Hy@steplink, \ttl at Hy@PatchSaveWrite, \ttl at Hy@refstepcounter
+
+(titletoc) \ttl at gobblecontents
+
+(varioref) \vref at pagenum, \refstepcounter
+
+(longtable) \LT at array? \LT at start (anchor)?
+
+(amsmath): \equation, \endequation (anchors), \eqnarray, \endeqnarray, eqnarray*, endeqnarray*, subeqnarray, \endsubeqnarray, \subequations
+
+(cleveref) \@thm
+
+(amsthm) \@thm
+
+==========
+with hyperfootnotes:
+
+\@footnotetext, \@footnotemark, \@mpfootnotetext 
+
+(tabularx): \TX at endtabularx to add code for footnotes.
+
+(longtable): \LT at p@ftntext for something with footnotes
+
+(fancyvrb): \V@@footnotetext
+
+\footref
+
+\maketitle (something with foonotes)
+========
+
+\caption, \@caption: anchors
+
+(float): \float at makebox for anchor
+
+\bibcite, \@lbibitem, \@bibitem for anchors (unless natbib is loaded)
+
+(revtex) \@CITEX, \@citex
+
+(harvard) \HAR at citetoaux, \harvardcite, \harvarditem, \@harvarditem, \HAR at checkcitations
+
+(chicago) \shortciteN, \citeN, \@citedata at opt, ...
+
+(slides) \slide, \note, \overlay, ... for page anchors
+
+\addcontentsline (destination name, bookmarks code, writes a \contentsline with four arguments)
+
+\contentsline: uses fourth argument to build \Hy at tocdestname and to add a link in l@#1: 
+      \csname l@#1\endcsname{%
+        \hyper at linkstart{link}{\Hy at tocdestname}{#2}\hyper at linkend
+      }{#3}%
+      
+\@definecounter, \@newctr, \@addtoreset: adds a setup for \theH<counter>      
+
+(amsmath): \df at tag (for anchor)
+
+\@seteqlabel (only with pdftex??)
+
+(amsmath) \numberwithin for \theHcounter
+
+\Gin at setfile (if hyperfigures, makes them a destination?)
+
+\@wrindex, \@@wrindex: index stuff
+
+A number of providing H-counter for various classes/styles: foils, seminar
+
+(slidesec): a number of patches for hyperref stuff.
+
+\@setref, \@pagesetref: to get link
\ No newline at end of file
diff --git a/test-ocg-properties.tex b/test-ocg-properties.tex
new file mode 100644
index 0000000..81ae56e
--- /dev/null
+++ b/test-ocg-properties.tex
@@ -0,0 +1,32 @@
+% !Mode:: "TeX:UTF-8:Main"
+\pdfcompresslevel0
+\pdfobjcompresslevel0
+\documentclass{article}
+
+\usepackage[a6paper]{geometry}
+
+\usepackage{ocgx2}
+\usepackage{color}
+
+\begin{document}
+
+Some \begin{ocg}{red}{red}{on}
+{\color{red}layered text.}
+\end{ocg}
+
+
+\newpage
+
+More \begin{ocg}{blue}{blue}{on}
+{\color{blue}layered text.}
+\end{ocg}
+
+\begin{figure}[p]
+
+Some \begin{ocg}{red}{red}{on}
+{\color{red}layered text.}
+\end{ocg}
+
+\end{figure}
+
+\end{document}
\ No newline at end of file





More information about the latex3-commits mailing list