From ba9e29bb9d031c5aa86ba18aac3fbe3db84f5339 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 9 Nov 2023 22:07:14 +0000 Subject: newpax (9nov23) git-svn-id: svn://tug.org/texlive/trunk@68762 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/newpax/newpax.lua | 25 +++++++++++++++++++++---- Master/texmf-dist/tex/latex/newpax/newpax.sty | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/tex/latex/newpax') diff --git a/Master/texmf-dist/tex/latex/newpax/newpax.lua b/Master/texmf-dist/tex/latex/newpax/newpax.lua index 549effa1ac0..68df46fd1f4 100644 --- a/Master/texmf-dist/tex/latex/newpax/newpax.lua +++ b/Master/texmf-dist/tex/latex/newpax/newpax.lua @@ -20,8 +20,8 @@ -- local ProvidesLuaModule = { name = "newpax", - version = "0.54", --TAGVERSION - date = "2023-09-11", --TAGDATE + version = "0.55", --TAGVERSION + date = "2023-11-08", --TAGDATE description = "newpax lua code", license = "The LATEX Project Public License 1.3c" } @@ -180,9 +180,17 @@ end -- destinations can be an dict (/D [array]) or only an array! local function getdestdata (name,pagereftonum,destnamestoref) - local destref = destnamestoref[name] + local destref local type,ref,pagenum,destx,desty = nil, nil, 1,0,0 local data = {{0,0}, {5,constDEST_XYZ}} + -- if we get directly an array + if (TYPE(name) == "pdfe.array") then + data = ARRAYTOTABLE(name) + type, ref, pageref = GETFROMARRAY(name,1) + pagenum = pagereftonum[pageref] + else + destref = destnamestoref[name] + end if destref then type,value,detail = GETFROMREFERENCE(destref) if TYPE(value) == "pdfe.dictionary" then @@ -198,6 +206,7 @@ local function getdestdata (name,pagereftonum,destnamestoref) pagenum = pagereftonum[pageref] end end + -- print("XXXXXXXXXX",table.serialize(data),pagenum) return pagenum, data end @@ -568,13 +577,21 @@ local function __writepax (ext,file) WRITE (collected_destinations[i]) end -- write out the rest of the destinations. + -- We order first the table so that the newpax file doesn't change between + -- compilations, see issue #25 and PR #25 + local destnamessorted = {} for k,v in pairs (destnamestorefVAR) do -- ignore use dests and page destinations. i=string.find(k,"page.",1) if not useddestnames[k] and not i then + table.insert (destnamessorted,k) + end + end + table.sort(destnamessorted) + for i = 1, #destnamessorted do + k=destnamessorted[i] destcountVAR=destcountVAR + 1 WRITE(outputENTRY_dest(destcountVAR,k,pagereftonumVAR,destnamestorefVAR,docVAR)) - end end io.close(writeVAR) end diff --git a/Master/texmf-dist/tex/latex/newpax/newpax.sty b/Master/texmf-dist/tex/latex/newpax/newpax.sty index dae7710a71c..9444fba042d 100644 --- a/Master/texmf-dist/tex/latex/newpax/newpax.sty +++ b/Master/texmf-dist/tex/latex/newpax/newpax.sty @@ -20,7 +20,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2022-11-01] \ProvidesPackage{newpax}% - [2023-09-11 v0.54 Annotation support for PDF graphics based on pax.sty adapted by (UF)]% + [2023-11-08 v0.55 Annotation support for PDF graphics based on pax.sty adapted by (UF)]% \ExplSyntaxOn \IfDocumentMetadataTF {} -- cgit v1.2.3