summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-12-24 03:01:20 +0000
committerNorbert Preining <norbert@preining.info>2022-12-24 03:01:20 +0000
commitda0bd16b0ba9d42d044af47137003788f0b7f773 (patch)
treec7681ad6dfc80d15e6439d6e981c48046acee3f8 /macros/latex/contrib/tagpdf/tagpdf-backend.dtx
parentb2b552bfe4933283e7d61d721bea40b0dd2bb9fb (diff)
CTAN sync 202212240301
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-backend.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-backend.dtx45
1 files changed, 34 insertions, 11 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
index 800a6bfa46..47369b519b 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.97, released 2022-08-24}
+% \date{Version 0.98, released 2022-12-22}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2022-08-24} {0.97}
+\ProvidesExplFile {tagpdf-luatex.def} {2022-12-22} {0.98}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -146,6 +146,7 @@
}
% \end{macrocode}
% \end{macro}
+%
% \begin{macrocode}
%</luatex>
% \end{macrocode}
@@ -157,8 +158,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.97", --TAGVERSION
- date = "2022-08-24", --TAGDATE
+ version = "0.98", --TAGVERSION
+ date = "2022-12-22", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
@@ -282,6 +283,7 @@ ltx.@@.struct = ltx.@@.struct or { } -- struct data
ltx.@@.tables = ltx.@@.tables or { } -- tables created with new prop and new seq.
-- wasn't a so great idea ...
-- g_@@_role_tags_seq used by tag<-> is in this tables!
+ -- used for pure lua tables too now!
ltx.@@.page = ltx.@@.page or { } -- page data, currently only i->{0->mcnum,1->mcnum,...}
ltx.@@.trace = ltx.@@.trace or { } -- show commands
ltx.@@.func = ltx.@@.func or { } -- functions
@@ -437,7 +439,28 @@ local function @@_get_mathsubtype (mathnode)
end
% \end{macrocode}
% \end{macro}
-
+%
+% \begin{variable}{ltx.@@.tables.role_tag_attribute,ltx.@@.tables.role_tag_attribute}
+% The first is a table with key a tag and value a number (the attribute)
+% The second is an array with the attribute value as key.
+% \begin{macrocode}
+ltx.@@.tables.role_tag_attribute = {}
+ltx.@@.tables.role_attribute_tag = {}
+% \end{macrocode}
+% \end{variable}
+% \begin{macro}{ltx.@@.func.alloctag}
+% \begin{macrocode}
+local @@_alloctag =
+ function (tag)
+ if not ltx.@@.tables.role_tag_attribute[tag] then
+ table.insert(ltx.@@.tables.role_attribute_tag,tag)
+ ltx.@@.tables.role_tag_attribute[tag]=#ltx.@@.tables.role_attribute_tag
+ @@_log ("Add "..tag.." "..ltx.@@.tables.role_tag_attribute[tag],3)
+ end
+ end
+ltx.@@.func.alloctag = @@_alloctag
+% \end{macrocode}
+% \end{macro}
% \begin{macro}
% {
% @@_get_num_from,
@@ -451,8 +474,8 @@ end
% \begin{macrocode}
local @@_get_num_from =
function (tag)
- if ltx.@@.tables["g_@@_role_tags_prop"][tag] then
- a= ltx.@@.tables["g_@@_role_tags_prop"][tag]
+ if ltx.@@.tables.role_tag_attribute[tag] then
+ a= ltx.@@.tables.role_tag_attribute[tag]
else
a= -1
end
@@ -479,13 +502,13 @@ end
% }
% These functions are the opposites to the previous function:
% they take as argument a number (the attribute value) and return the string |tag|.
-% The first function outputs the number for lua, while the |output| function
+% The first function outputs the string for lua, while the |output| function
% outputs to tex.
% \begin{macrocode}
local @@_get_tag_from =
function (num)
- if ltx.@@.tables["g_@@_role_tags_seq"][num] then
- a = ltx.@@.tables["g_@@_role_tags_seq"][num]
+ if ltx.@@.tables.role_attribute_tag[num] then
+ a = ltx.@@.tables.role_attribute_tag[num]
else
a= "UNKNOWN"
end
@@ -924,7 +947,7 @@ function ltx.@@.func.mark_page_elements (box,mcpagecnt,mccntprev,mcopen,name,mct
elseif n.id == VLIST then -- enter the vlist
mcopen,mcpagecnt,mccntprev,mctypeprev=
ltx.@@.func.mark_page_elements (n,mcpagecnt,mccntprev,mcopen,"INTERNAL VLIST",mctypeprev)
- elseif n.id == GLUE then -- at glue real space chars are inserted, but this has
+ elseif n.id == GLUE and not n.leader then -- at glue real space chars are inserted, but this has
-- been done if the previous shipout wandering, so here it is ignored
elseif n.id == LOCAL_PAR then -- local_par is ignored
elseif n.id == PENALTY then -- penalty is ignored