summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/newpax/newpax.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/newpax/newpax.dtx')
-rw-r--r--Master/texmf-dist/source/latex/newpax/newpax.dtx67
1 files changed, 50 insertions, 17 deletions
diff --git a/Master/texmf-dist/source/latex/newpax/newpax.dtx b/Master/texmf-dist/source/latex/newpax/newpax.dtx
index 44c6dbe16a8..0d32683bd42 100644
--- a/Master/texmf-dist/source/latex/newpax/newpax.dtx
+++ b/Master/texmf-dist/source/latex/newpax/newpax.dtx
@@ -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@htype@Named{link}
\def\NEWPAX@htype@URI{url}
+\ExplSyntaxOn
\def\NEWPAX@link@URI{%
\NEWPAX@pdf@annot{%
- /URI\NEWPAX@key@URI
+ /URI\tl_to_str:V\NEWPAX@key@URI
}%
}
-\ExplSyntaxOn
\def\NEWPAX@link@Named{%
\NEWPAX@pdf@annot{%
/N \pdf_name_from_unicode_e:n{\NEWPAX@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 @@ local function outputKV_N (pdfedict)
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 @@ local function outputENTRY_dest (destcount,name,pagereftonum,destnamestoref,pdfe
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