texlive[64415] Master/texmf-dist: newpax (16sep22)
commits+karl at tug.org
commits+karl at tug.org
Fri Sep 16 22:39:06 CEST 2022
Revision: 64415
http://tug.org/svn/texlive?view=revision&revision=64415
Author: karl
Date: 2022-09-16 22:39:06 +0200 (Fri, 16 Sep 2022)
Log Message:
-----------
newpax (16sep22)
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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/doc/latex/newpax/README.md 2022-09-16 20:39:06 UTC (rev 64415)
@@ -7,7 +7,7 @@
The package is based on and uses code from [pax](https://ctan.org/pkg/pax) by Heiko Oberdiek.
-Packageversion: 0.52
+Packageversion: 0.53
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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-input1.tex 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-input2.tex 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-use-newpax.tex 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/doc/latex/newpax/doc-use-pax.tex 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/doc/latex/newpax/newpax.tex 2022-09-16 20:39:06 UTC (rev 64415)
@@ -1,10 +1,9 @@
% !Mode:: "TeX:UTF-8:Main"
\makeatletter
-\def\UlrikeFischer at package@version{0.52}
-\def\UlrikeFischer at package@date{2022-09-11}
+\def\UlrikeFischer at package@version{0.53}
+\def\UlrikeFischer at package@date{2022-09-15}
\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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/source/latex/newpax/newpax.dtx 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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-09-15 v0.53 Annotation support for PDF graphics based on pax.sty adapted by (UF)]%
\ExplSyntaxOn
\bool_if:nF
{
@@ -39,7 +39,7 @@
\PackageError{newpax}
{
PDF~resource~management~code~not~found!\MessageBreak
- newpage~will~no~work.
+ newpax~will~no~work.
}
{
Load~it~with \MessageBreak
@@ -701,8 +701,8 @@
%<*lua>
local ProvidesLuaModule = {
name = "newpax",
- version = "0.52", --TAGVERSION
- date = "2022-09-11", --TAGDATE
+ version = "0.53", --TAGVERSION
+ date = "2022-09-15", --TAGDATE
description = "newpax lua code",
license = "The LATEX Project Public License 1.3c"
}
@@ -1015,6 +1015,9 @@
local function outputKV_uri (pdfedict)
local type, value, hex = GETFROMDICTIONARY(pdfedict,constKEY_URI)
+ if TYPE(value) == "pdfe.reference" then
+ type,value,hex = GETFROMREFERENCE(value)
+ end
local a= strKV_BEG .. constKEY_URI .. strVALUE_BEG
if hex then
a = a .. strHEX_STR_BEG .. value .. strHEX_STR_END
@@ -1031,24 +1034,54 @@
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 tkeys = {}
+ local dict = DICTIONARYTOTABLE(dictionary)
+ for name,value in pairs(dict) do
+ table.insert(tkeys,name)
+ end
+ table.sort(tkeys)
+ local a = "<<"
+ for _,k in ipairs (tkeys) do
+ v=dict[k]
+ 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, desttype, destvalue, hex
- local checktype, checkvalue, checkhex = GETFROMDICTIONARY(pdfedict,"F")
- if checktype==10 then
- -- TODO resolve reference deeper!!
- local a,b,c= GETFROMREFERENCE(checkvalue)
- type, value, hex = GETFROMDICTIONARY(b,"F")
- desttype,destvalue = GETFROMDICTIONARY(b,"D")
- else
- value=checkvalue
- desttype,destvalue = GETFROMDICTIONARY(pdfedict,"D")
- end
+ 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
Modified: trunk/Master/texmf-dist/source/latex/newpax/newpax.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/newpax/newpax.ins 2022-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/source/latex/newpax/newpax.ins 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/tex/latex/newpax/newpax.lua 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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.52", --TAGVERSION
- date = "2022-09-11", --TAGDATE
+ version = "0.53", --TAGVERSION
+ date = "2022-09-15", --TAGDATE
description = "newpax lua code",
license = "The LATEX Project Public License 1.3c"
}
@@ -325,6 +325,9 @@
local function outputKV_uri (pdfedict)
local type, value, hex = GETFROMDICTIONARY(pdfedict,constKEY_URI)
+ if TYPE(value) == "pdfe.reference" then
+ type,value,hex = GETFROMREFERENCE(value)
+ end
local a= strKV_BEG .. constKEY_URI .. strVALUE_BEG
if hex then
a = a .. strHEX_STR_BEG .. value .. strHEX_STR_END
@@ -341,24 +344,54 @@
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 tkeys = {}
+ local dict = DICTIONARYTOTABLE(dictionary)
+ for name,value in pairs(dict) do
+ table.insert(tkeys,name)
+ end
+ table.sort(tkeys)
+ local a = "<<"
+ for _,k in ipairs (tkeys) do
+ v=dict[k]
+ 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, desttype, destvalue, hex
- local checktype, checkvalue, checkhex = GETFROMDICTIONARY(pdfedict,"F")
- if checktype==10 then
- -- TODO resolve reference deeper!!
- local a,b,c= GETFROMREFERENCE(checkvalue)
- type, value, hex = GETFROMDICTIONARY(b,"F")
- desttype,destvalue = GETFROMDICTIONARY(b,"D")
- else
- value=checkvalue
- desttype,destvalue = GETFROMDICTIONARY(pdfedict,"D")
- end
+ 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
Modified: trunk/Master/texmf-dist/tex/latex/newpax/newpax.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/newpax/newpax.sty 2022-09-16 20:38:43 UTC (rev 64414)
+++ trunk/Master/texmf-dist/tex/latex/newpax/newpax.sty 2022-09-16 20:39:06 UTC (rev 64415)
@@ -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-09-15 v0.53 Annotation support for PDF graphics based on pax.sty adapted by (UF)]%
\ExplSyntaxOn
\bool_if:nF
{
@@ -30,7 +30,7 @@
\PackageError{newpax}
{
PDF~resource~management~code~not~found!\MessageBreak
- newpage~will~no~work.
+ newpax~will~no~work.
}
{
Load~it~with \MessageBreak
More information about the tex-live-commits
mailing list.