summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-04-14 03:00:50 +0000
committerNorbert Preining <norbert@preining.info>2024-04-14 03:00:50 +0000
commitad42b96b7e6aa836e884a18da3f45d53dc779145 (patch)
treeeed2ae1a2aca7542edc24a57fcbc7402307c72ba /macros/latex/contrib/tagpdf/tagpdf-backend.dtx
parent8c3c68877a46b9b70b5d02c8582595e90be9737a (diff)
CTAN sync 202404140300
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-backend.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-backend.dtx38
1 files changed, 24 insertions, 14 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
index e15316252e..0f388b2542 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.99a, released 2024-03-27}
+% \date{Version 0.99b, released 2024-04-12}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2024-03-27} {0.99a}
+\ProvidesExplFile {tagpdf-luatex.def} {2024-04-12} {0.99b}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -164,8 +164,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.99a", --TAGVERSION
- date = "2024-03-27", --TAGDATE
+ version = "0.99b", --TAGVERSION
+ date = "2024-04-12", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
@@ -215,7 +215,7 @@ functions
ltx.@@.func.mark_shipout (): a wrapper around the core function which inserts the last EMC
ltx.@@.func.fill_parent_tree_line (page): outputs the entries of the parenttree for this page
ltx.@@.func.output_parenttree(): outputs the content of the parenttree
- ltx.@@.func.pdf_object_ref(name): outputs the object reference for the object name
+ ltx.@@.func.pdf_object_ref(name,index): outputs the object reference for the object name
ltx.@@.func.markspaceon(), ltx.@@.func.markspaceoff(): (de)activates the marking of positions for space chars
ltx.@@.trace.show_mc_data (num,loglevel): shows ltx.@@.mc[num] is the current log level is >= loglevel
ltx.@@.trace.show_all_mc_data (max,loglevel): shows a maximum about mc's if the current log level is >= loglevel
@@ -237,9 +237,12 @@ functions
% The interwordfont attr is set by the function |@@_mark_spaces| too and
% stores the font, so that we can decide which font
% to use for the real space char.
+% The interwordspaceOff attr allows to locally suppress the insertion of
+% real space chars, e.g. when they are inserted by other means (e.g. with |\char|).
% \begin{macrocode}
local mctypeattributeid = luatexbase.new_attribute ("g_@@_mc_type_attr")
local mccntattributeid = luatexbase.new_attribute ("g_@@_mc_cnt_attr")
+local iwspaceOffattributeid = luatexbase.new_attribute ("g__tag_interwordspaceOff_attr")
local iwspaceattributeid = luatexbase.new_attribute ("g_@@_interwordspace_attr")
local iwfontattributeid = luatexbase.new_attribute ("g_@@_interwordfont_attr")
% \end{macrocode}
@@ -698,17 +701,21 @@ local function @@_insert_bdc_node (head,current,tag,dict)
end
% \end{macrocode}
% \end{macro}
-% \begin{macro}{@@_pdf_object_ref,ltx.@@.func.pdf_object_ref}
+% \begin{macro}{@@_pdf_object_ref}
% This allows to reference a pdf object reserved with the l3pdf command by name.
% The return value is |n 0 R|, if the object doesn't exist, n is 0.
-% TODO: is uses internal l3pdf commands, this should be properly supported by l3pdf
% \begin{macrocode}
-local function @@_pdf_object_ref (name)
- local tokenname = 'c__pdf_object_'..name..'_int'
- local object = token.create(tokenname).mode ..' 0 R'
+local function @@_pdf_object_ref (name,index)
+ local object
+ if ltx.pdf.object_id then
+ object = ltx.pdf.object_id (name,index) ..' 0 R'
+ else
+ local tokenname = 'c__pdf_object_'..name..'/'..index..'_int'
+ object = token.create(tokenname).mode ..' 0 R'
+ end
return object
end
-ltx.@@.func.pdf_object_ref=@@_pdf_object_ref
+ltx.@@.func.pdf_object_ref = @@_pdf_object_ref
% \end{macrocode}
% \end{macro}
%
@@ -877,7 +884,10 @@ local function @@_space_chars_shipout (box)
local head = box.head
if head then
for n in node.traverse(head) do
- local spaceattr = nodegetattribute(n,iwspaceattributeid) or -1
+ local spaceattr = -1
+ if not nodehasattribute(n,iwspaceOffattributeid) then
+ spaceattr = nodegetattribute(n,iwspaceattributeid) or -1
+ end
if n.id == HLIST then -- enter the hlist
@@_space_chars_shipout (n)
elseif n.id == VLIST then -- enter the vlist
@@ -1222,7 +1232,7 @@ function ltx.@@.func.fill_parent_tree_line (page)
local structnum = ltx.@@.mc[mcnum]["parent"]
local propname = "g_@@_struct_"..structnum.."_prop"
--local objref = ltx.@@.tables[propname]["objref"] or "XXXX"
- local objref = @@_pdf_object_ref('@@/struct/'..structnum)
+ local objref = @@_pdf_object_ref('@@/struct',structnum)
ltx.@@.trace.log("INFO PARENTTREE-STRUCT-OBJREF: =====>"..
tostring(objref),5)
numsentry = pdfpage .. " [".. objref .. "]"
@@ -1235,7 +1245,7 @@ function ltx.@@.func.fill_parent_tree_line (page)
local structnum = ltx.@@.mc[mcnum]["parent"] or 0
local propname = "g_@@_struct_"..structnum.."_prop"
--local objref = ltx.@@.tables[propname]["objref"] or "XXXX"
- local objref = @@_pdf_object_ref('@@/struct/'..structnum)
+ local objref = @@_pdf_object_ref('@@/struct',structnum)
numsentry = numsentry .. " ".. objref
end
numsentry = numsentry .. "] "