texlive[63749] Master/texmf-dist: newpax (28jun22)

commits+karl at tug.org commits+karl at tug.org
Tue Jun 28 23:08:15 CEST 2022


Revision: 63749
          http://tug.org/svn/texlive?view=revision&revision=63749
Author:   karl
Date:     2022-06-28 23:08:15 +0200 (Tue, 28 Jun 2022)
Log Message:
-----------
newpax (28jun22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/newpax/README.md
    trunk/Master/texmf-dist/doc/latex/newpax/doc-input1.pdf
    trunk/Master/texmf-dist/doc/latex/newpax/doc-input1.tex
    trunk/Master/texmf-dist/doc/latex/newpax/doc-input2.pdf
    trunk/Master/texmf-dist/doc/latex/newpax/doc-input2.tex
    trunk/Master/texmf-dist/doc/latex/newpax/doc-use-newpax.pdf
    trunk/Master/texmf-dist/doc/latex/newpax/doc-use-newpax.tex
    trunk/Master/texmf-dist/doc/latex/newpax/doc-use-pax.pdf
    trunk/Master/texmf-dist/doc/latex/newpax/doc-use-pax.tex
    trunk/Master/texmf-dist/doc/latex/newpax/newpax.pdf
    trunk/Master/texmf-dist/doc/latex/newpax/newpax.tex
    trunk/Master/texmf-dist/source/latex/newpax/newpax.dtx
    trunk/Master/texmf-dist/source/latex/newpax/newpax.ins
    trunk/Master/texmf-dist/tex/latex/newpax/newpax.lua
    trunk/Master/texmf-dist/tex/latex/newpax/newpax.sty

Modified: trunk/Master/texmf-dist/doc/latex/newpax/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/newpax/README.md	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/doc/latex/newpax/README.md	2022-06-28 21:08:15 UTC (rev 63749)
@@ -7,7 +7,7 @@
 
 The package is based on and uses code from [pax](https://ctan.org/pkg/pax) by Heiko Oberdiek.
 
-Packageversion: 0.51 
+Packageversion: 0.52 
 Packagedate: 2021-02-26
 Author: Ulrike Fischer
 

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-input1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-input1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/newpax/doc-input1.tex	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-input1.tex	2022-06-28 21:08:15 UTC (rev 63749)
@@ -1,6 +1,5 @@
 % !Mode:: "TeX:UTF-8:Main"
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{uncompress}
+\DocumentMetadata{uncompress}
 \documentclass{article}
 \usepackage{hyperref}
 

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-input2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-input2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/newpax/doc-input2.tex	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-input2.tex	2022-06-28 21:08:15 UTC (rev 63749)
@@ -1,6 +1,5 @@
 % !Mode:: "TeX:UTF-8:Main"
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{uncompress}
+\DocumentMetadata{uncompress}
 \documentclass{article}
 \usepackage{hyperref}
 

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-use-newpax.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-use-newpax.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/newpax/doc-use-newpax.tex	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-use-newpax.tex	2022-06-28 21:08:15 UTC (rev 63749)
@@ -1,7 +1,7 @@
 % !Mode:: "TeX:UTF-8:Main"
-
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{uncompress}
+% The next command needs LaTeX 2022-06-01, for older formats see documentation
+% of pdfmanagement-testphase
+\DocumentMetadata{uncompress}
 \documentclass{article}
 
 \usepackage{pdfpages,xcolor}

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-use-pax.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/newpax/doc-use-pax.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/newpax/doc-use-pax.tex	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-use-pax.tex	2022-06-28 21:08:15 UTC (rev 63749)
@@ -16,6 +16,10 @@
 %correct a bug in pax affecting clipping
 \makeatletter
 \patchcmd\PAX at pdf@annot{\PAX at pagellx}{\PAX at page@llx}{}{\fail}
+%allow hashes and percent in the pax file
+\patchcmd\PAX at AddAnnots{\InputIfFileExists\PAX at file{}{\typeout{* Missing: \PAX at file}}}
+ {\begingroup \catcode`\#=12 \catcode`\%=12
+  \InputIfFileExists\PAX at file{}{\typeout{* Missing: \PAX at file}}\endgroup}{}{\fail}
 \makeatother
 \begin{document}
 \includegraphics[scale=0.5,trim=5cm 15cm 8cm 3cm,clip,page=2]{doc-input1}

Modified: trunk/Master/texmf-dist/doc/latex/newpax/newpax.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/newpax/newpax.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/newpax/newpax.tex	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/doc/latex/newpax/newpax.tex	2022-06-28 21:08:15 UTC (rev 63749)
@@ -1,10 +1,9 @@
 % !Mode:: "TeX:UTF-8:Main"
 \makeatletter
-\def\UlrikeFischer at package@version{0.51}
-\def\UlrikeFischer at package@date{2021-03-07}
+\def\UlrikeFischer at package@version{0.52}
+\def\UlrikeFischer at package@date{2022-06-27}
 \makeatother
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfversion=1.7,lang=en-UK, uncompress}
+\DocumentMetadata{pdfversion=1.7,lang=en-UK, uncompress}
 
 \documentclass[DIV=12,parskip=half-,bibliography=totoc]{scrartcl}
 \usepackage{scrlayer-scrpage}
@@ -53,7 +52,7 @@
 The action of such an annotation can be an external URL, but also an internal destination.
 Such destination are objects describing a page and some instructions how to display the page---again using absolute coordinates.
 
-When a PDF is included in another PDF---may it be with \cs{includegraphics} or with \cs{includepdf}--the annotation coordinates no longer make sense as they don't refer to the receiving page (and often the action of an annotation doesn't make sense either), so all TeX-engines and backends strip them away when including a PDF: the net effect is that external and internal links are lost.
+When a PDF is included in another PDF---may it be with \cs{includegraphics} or with \cs{includepdf}\hspace{0pt}---\hspace{0pt}the annotation coordinates no longer make sense as they don't refer to the receiving page (and often the action of an annotation doesn't make sense either), so all TeX-engines and backends strip them away when including a PDF: the net effect is that external and internal links are lost.
 
 The \pkg{pax} package from Heiko Oberdiek offers a solution for this problem: it extracts all the annotations
 and destinations of the included PDF in a text file, does some clever recalculations of their coordinates and reinserts them.
@@ -209,11 +208,12 @@
 \item This works with pdflatex and lualatex. lualatex needs the extra code demonstrated in the document.
 \item It needs two or three compilations until every reference is correct.
 \item There is a small typo in \pkg{pax.sty} which affects clipping, the patch shown in the listing correct this.
+\item In some cases the catcode of \# and \% must be set to letter to avoid errors. 
 \item Don't include PDFs with destinations twice as this will lead to duplicate destinations and pdflatex will complain.
 \item If annotations should not be reinserted remove the \texttt{.pax}-file.
 \item If \pkg{hyperref} is loaded you can change the color and style of link borders with hyperref options.
 \end{itemize}
+\enlargethispage{\baselineskip}
+\lstinputlisting[firstline=2,caption=doc-use-pax.tex,escapechar={}]{doc-use-pax.tex}
 
-\lstinputlisting[firstline=2,caption=doc-use-pax.tex]{doc-use-pax.tex}
-
 \end{document}

Modified: trunk/Master/texmf-dist/source/latex/newpax/newpax.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/newpax/newpax.dtx	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/source/latex/newpax/newpax.dtx	2022-06-28 21:08:15 UTC (rev 63749)
@@ -2,7 +2,7 @@
 %
 % File: newpax.dtx
 % Copyright 2006-2008, 2011, 2012 Heiko Oberdiek (original pax.sty)
-% Copyright (C) 2021 Ulrike Fischer
+% Copyright (C) 2021, 2022 Ulrike Fischer
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -29,7 +29,7 @@
 %<@@=newpax>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{newpax}%
-  [2021-03-07 v0.51 Annotation support for PDF graphics based on pax.sty adapted by (UF)]%
+  [2022-06-27 v0.52 Annotation support for PDF graphics based on pax.sty adapted by (UF)]%
 \ExplSyntaxOn
 \bool_if:nF
   {
@@ -493,12 +493,12 @@
 \def\NEWPAX at htype@Named{link}
 \def\NEWPAX at htype@URI{url}
 
+\ExplSyntaxOn
 \def\NEWPAX at link@URI{%
   \NEWPAX at pdf@annot{%
-    /URI\NEWPAX at key@URI
+    /URI\tl_to_str:V\NEWPAX at key@URI
   }%
 }
-\ExplSyntaxOn
 \def\NEWPAX at link@Named{%
   \NEWPAX at pdf@annot{%
     /N \pdf_name_from_unicode_e:n{\NEWPAX at key@Name} %the value is from a pdf so we can assume it is correctly escaped??
@@ -701,8 +701,8 @@
 %<*lua>
 local ProvidesLuaModule = {
     name          = "newpax",
-    version       = "0.51",       --TAGVERSION
-    date          = "2021-03-07", --TAGDATE
+    version       = "0.52",       --TAGVERSION
+    date          = "2022-06-27", --TAGDATE
     description   = "newpax lua code",
     license       = "The LATEX Project Public License 1.3c"
 }
@@ -1031,15 +1031,48 @@
   return a
 end
 
+-- if a gotoR has a filespec filespec we use this
+-- to output the reference. It is rather crude and handles only names and strings
+local function outputDICT (dictionary)
+ local dict = DICTIONARYTOTABLE(dictionary)
+ local a = "<<"
+ for k,v in pairs (dict) do
+   a = a .. strNAME.. k
+      if v[1]== 5 then -- it is a name
+       b = string.gsub(v[2], "/", "#2F")
+       a = a .. strNAME .. b
+      elseif v[1] == 6 then -- it is a string
+       local b
+       if v[3] then
+         b = "<" .. v[2] .. ">"
+       else
+         b = "(" .. v[2] .. ")"
+       end
+       a = a ..strRECT_SEP .. b
+       -- everything else is ignored for now!
+      end
+    end
+ a = a .. ">>"
+ return a
+end
+
 local function outputKV_gotor (pdfedict) -- action dictionary
   local type, value, hex = GETFROMDICTIONARY(pdfedict,"F")
   local desttype, destvalue, destdetail =  GETFROMDICTIONARY(pdfedict,"D")
   local a = strKV_BEG .. constKEY_FILE .. strVALUE_BEG
-  a =  strKV_BEG .. constKEY_FILE .. strVALUE_BEG
-  if hex then
-    a = a .. strHEX_STR_BEG .. value .. strHEX_STR_end
+  if TYPE(value) == "pdfe.reference" then
+     local x,dictionary  = GETFROMREFERENCE(value)
+     if TYPE(dictionary) == "pdfe.dictionary" then
+       a = a .. outputDICT (dictionary)
+     else
+      print("ERROR!? this is not a dictionary!!")
+     end
   else
-    a = a .. strLIT_STR_BEG .. value .. strLIT_STR_END
+   if hex then
+     a = a .. strHEX_STR_BEG .. value .. strHEX_STR_END
+   else
+     a = a .. strLIT_STR_BEG .. value .. strLIT_STR_END
+   end
   end
   a = a .. strVALUE_END .. strKV_END
   if desttype == 7 then
@@ -1071,35 +1104,35 @@
  a = a .. strARG_BEG .. data[2][2] .. strARG_END
  a = a .. strKVS_BEG
  if data[2][2] == constDEST_XYZ then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    else
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. mediabox[1] .. strVALUE_END .. strKV_END
    end
-   if data[4][2] then
+   if data[4] and data[4][2] then
     a = a .. strKV_BEG .. constKEY_DEST_Y .. strVALUE_BEG .. data[4][2] .. strVALUE_END .. strKV_END
    else
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. mediabox[4] .. strVALUE_END .. strKV_END
    end
-   if data[5][2] then
+   if data[5] and data[5][2] then
     a = a .. strKV_BEG .. constKEY_DEST_ZOOM .. strVALUE_BEG .. data[5][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FIT  then -- nothing to do
  elseif data[2][2] == constDEST_FITB then -- nothing to do
  elseif data[2][2] == constDEST_FITH then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_Y .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITBH then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_Y .. strVALUE_BEG  .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITV then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITBV then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITR and data[6] then

Modified: trunk/Master/texmf-dist/source/latex/newpax/newpax.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/newpax/newpax.ins	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/source/latex/newpax/newpax.ins	2022-06-28 21:08:15 UTC (rev 63749)
@@ -2,7 +2,7 @@
 
 File: newpax.ins
 
-Copyright (C) 2021 Ulrike Fischer
+Copyright (C) 2021,2022 Ulrike Fischer
 
 It may be distributed and/or modified under the conditions of the
 LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -34,7 +34,7 @@
 \let\MetaPrefix\relax
 \preamble
 
-Copyright (C) 2021 Ulrike Fischer
+Copyright (C) 2021,2022 Ulrike Fischer
 
 It may be distributed and/or modified under the conditions of
 the LaTeX Project Public License (LPPL), either version 1.3c of

Modified: trunk/Master/texmf-dist/tex/latex/newpax/newpax.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/newpax/newpax.lua	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/tex/latex/newpax/newpax.lua	2022-06-28 21:08:15 UTC (rev 63749)
@@ -6,7 +6,7 @@
 -- 
 --  newpax.dtx  (with options: `lua')
 --  
---  Copyright (C) 2021 Ulrike Fischer
+--  Copyright (C) 2021,2022 Ulrike Fischer
 --  
 --  It may be distributed and/or modified under the conditions of
 --  the LaTeX Project Public License (LPPL), either version 1.3c of
@@ -20,8 +20,8 @@
 --  
 local ProvidesLuaModule = {
     name          = "newpax",
-    version       = "0.51",       --TAGVERSION
-    date          = "2021-03-07", --TAGDATE
+    version       = "0.52",       --TAGVERSION
+    date          = "2022-06-27", --TAGDATE
     description   = "newpax lua code",
     license       = "The LATEX Project Public License 1.3c"
 }
@@ -341,15 +341,48 @@
   return a
 end
 
+-- if a gotoR has a filespec filespec we use this
+-- to output the reference. It is rather crude and handles only names and strings
+local function outputDICT (dictionary)
+ local dict = DICTIONARYTOTABLE(dictionary)
+ local a = "<<"
+ for k,v in pairs (dict) do
+   a = a .. strNAME.. k
+      if v[1]== 5 then -- it is a name
+       b = string.gsub(v[2], "/", "#2F")
+       a = a .. strNAME .. b
+      elseif v[1] == 6 then -- it is a string
+       local b
+       if v[3] then
+         b = "<" .. v[2] .. ">"
+       else
+         b = "(" .. v[2] .. ")"
+       end
+       a = a ..strRECT_SEP .. b
+       -- everything else is ignored for now!
+      end
+    end
+ a = a .. ">>"
+ return a
+end
+
 local function outputKV_gotor (pdfedict) -- action dictionary
   local type, value, hex = GETFROMDICTIONARY(pdfedict,"F")
   local desttype, destvalue, destdetail =  GETFROMDICTIONARY(pdfedict,"D")
   local a = strKV_BEG .. constKEY_FILE .. strVALUE_BEG
-  a =  strKV_BEG .. constKEY_FILE .. strVALUE_BEG
-  if hex then
-    a = a .. strHEX_STR_BEG .. value .. strHEX_STR_end
+  if TYPE(value) == "pdfe.reference" then
+     local x,dictionary  = GETFROMREFERENCE(value)
+     if TYPE(dictionary) == "pdfe.dictionary" then
+       a = a .. outputDICT (dictionary)
+     else
+      print("ERROR!? this is not a dictionary!!")
+     end
   else
-    a = a .. strLIT_STR_BEG .. value .. strLIT_STR_END
+   if hex then
+     a = a .. strHEX_STR_BEG .. value .. strHEX_STR_END
+   else
+     a = a .. strLIT_STR_BEG .. value .. strLIT_STR_END
+   end
   end
   a = a .. strVALUE_END .. strKV_END
   if desttype == 7 then
@@ -380,35 +413,35 @@
  a = a .. strARG_BEG .. data[2][2] .. strARG_END
  a = a .. strKVS_BEG
  if data[2][2] == constDEST_XYZ then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    else
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. mediabox[1] .. strVALUE_END .. strKV_END
    end
-   if data[4][2] then
+   if data[4] and data[4][2] then
     a = a .. strKV_BEG .. constKEY_DEST_Y .. strVALUE_BEG .. data[4][2] .. strVALUE_END .. strKV_END
    else
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. mediabox[4] .. strVALUE_END .. strKV_END
    end
-   if data[5][2] then
+   if data[5] and data[5][2] then
     a = a .. strKV_BEG .. constKEY_DEST_ZOOM .. strVALUE_BEG .. data[5][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FIT  then -- nothing to do
  elseif data[2][2] == constDEST_FITB then -- nothing to do
  elseif data[2][2] == constDEST_FITH then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_Y .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITBH then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_Y .. strVALUE_BEG  .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITV then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITBV then
-   if data[3][2] then
+   if data[3] and data[3][2] then
     a = a .. strKV_BEG .. constKEY_DEST_X .. strVALUE_BEG .. data[3][2] .. strVALUE_END .. strKV_END
    end
  elseif data[2][2] == constDEST_FITR and data[6] then

Modified: trunk/Master/texmf-dist/tex/latex/newpax/newpax.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/newpax/newpax.sty	2022-06-28 21:08:00 UTC (rev 63748)
+++ trunk/Master/texmf-dist/tex/latex/newpax/newpax.sty	2022-06-28 21:08:15 UTC (rev 63749)
@@ -6,7 +6,7 @@
 %%
 %% newpax.dtx  (with options: `package')
 %% 
-%% Copyright (C) 2021 Ulrike Fischer
+%% Copyright (C) 2021,2022 Ulrike Fischer
 %% 
 %% It may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License (LPPL), either version 1.3c of
@@ -20,7 +20,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{newpax}%
-  [2021-03-07 v0.51 Annotation support for PDF graphics based on pax.sty adapted by (UF)]%
+  [2022-06-27 v0.52 Annotation support for PDF graphics based on pax.sty adapted by (UF)]%
 \ExplSyntaxOn
 \bool_if:nF
   {
@@ -472,12 +472,12 @@
 \def\NEWPAX at htype@Named{link}
 \def\NEWPAX at htype@URI{url}
 
+\ExplSyntaxOn
 \def\NEWPAX at link@URI{%
   \NEWPAX at pdf@annot{%
-    /URI\NEWPAX at key@URI
+    /URI\tl_to_str:V\NEWPAX at key@URI
   }%
 }
-\ExplSyntaxOn
 \def\NEWPAX at link@Named{%
   \NEWPAX at pdf@annot{%
     /N \pdf_name_from_unicode_e:n{\NEWPAX at key@Name} %the value is from a pdf so we can assume it is correctly escaped??



More information about the tex-live-commits mailing list.