summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-struct.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-struct.dtx40
1 files changed, 35 insertions, 5 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
index 1299cc10e9..2e83d51280 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -242,7 +242,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-struct-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -507,6 +507,24 @@
% \end{macrocode}
% \end{variable}
%
+% \subsection{Adding the /ID key}
+% Every structure gets automatically an ID which is currently
+% simply calculated from the structure number.
+% \begin{macro}{\@@_struct_get_id:n}
+% \begin{macrocode}
+\cs_new:Npn \@@_struct_get_id:n #1 %#1=struct num
+ {
+ (
+ ID.
+ \prg_replicate:nn
+ { \int_abs:n{\g_@@_tree_id_pad_int - \tl_count:e { \int_to_arabic:n { #1 } }} }
+ { 0 }
+ \int_to_arabic:n { #1 }
+ )
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Filling in the tag info}
% \begin{macro}{\@@_struct_set_tag_info:nnn }
@@ -808,7 +826,8 @@
{ @@/struct/#1 }
{dict}
{
- \l_@@_tmpa_tl
+ \l_@@_tmpa_tl\c_space_tl
+ /ID~\@@_struct_get_id:n{#1}
}
}
{
@@ -884,7 +903,7 @@
%
% \begin{macro}{\@@_get_data_struct_tag:}
% this command allows \cs{tag_get:n} to get the current
-% structure tag with the keyword |struct_tag|. We will need to handle nesting
+% structure tag with the keyword |struct_tag|.
% \begin{macrocode}
\cs_new:Npn \@@_get_data_struct_tag:
{
@@ -894,6 +913,17 @@
\prop_item:cn {g_@@_struct_\g_@@_struct_stack_current_tl _prop}{S}
}
}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_get_data_struct_id:}
+% this command allows \cs{tag_get:n} to get the current
+% structure id with the keyword |struct_id|.
+% \begin{macrocode}
+\cs_new:Npn \@@_get_data_struct_id:
+ {
+ \@@_struct_get_id:n {\g_@@_struct_stack_current_tl}
+ }
%</package>
% \end{macrocode}
% \end{macro}
@@ -1480,7 +1510,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-attr-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}