summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
committerNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
commitf325bd88d1d4db13f51277bc59c8ff8814e937bc (patch)
treee39af6619c91d812dd93cb57d25149da5a84d801 /macros/latex/contrib/tagpdf/tagpdf-struct.dtx
parente7a321bba289c40f39563c19bbeac355f7c0eeeb (diff)
CTAN sync 202402240301
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-struct.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-struct.dtx73
1 files changed, 52 insertions, 21 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
index 2e8b69d7e5..3cdced94d1 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.98v, released 2024-02-04}
+% \date{Version 0.98w, released 2024-02-22}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -254,9 +254,9 @@
% must be declared first in \cs{tagpdfsetup}.
% \end{function}
% \subsection{Setup keys}
-% \begin{function}{newattribute (setup-key)}
+% \begin{function}{role/new-attribute (setup-key), newattribute (deprecated)}
% \begin{syntax}
-% newattribute = \Arg{name}\Arg{Content}
+% role/new-attribute = \Arg{name}\Arg{Content}
% \end{syntax}
% This key can be used in the setup command \cs{tagpdfsetup} and allow to declare a
% new attribute, which can be used as attribute or attribute class.
@@ -264,9 +264,9 @@
% \begin{verbatim}
% \tagpdfsetup
% {
-% newattribute =
+% role/new-attribute =
% {TH-col}{/O /Table /Scope /Column},
-% newattribute =
+% role/new-attribute =
% {TH-row}{/O /Table /Scope /Row},
% }
% \end{verbatim}
@@ -285,7 +285,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2024-02-04} {0.98v}
+\ProvidesExplPackage {tagpdf-struct-code} {2024-02-22} {0.98w}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -464,7 +464,7 @@
% It is currently used by the toc-tagging and sec-tagging code.
% \begin{macrocode}
%</package>
-%<base>\prop_new:N \g_@@_struct_dest_num_prop
+%<base>\prop_new_linked:N \g_@@_struct_dest_num_prop
%<*package>
% \end{macrocode}
% \end{variable}
@@ -474,7 +474,7 @@
% at the end to point to structured related with this destination.
% As this is probably need in other places too, it is not only a toc-variable.
% \begin{macrocode}
-\prop_new:N \g_@@_struct_ref_by_dest_prop
+\prop_new_linked:N \g_@@_struct_ref_by_dest_prop
% \end{macrocode}
% \end{variable}
%
@@ -1113,6 +1113,33 @@
% This are the keys for the user commands.
% we store the tag in a variable. But we should be careful, it is only reliable
% at the begin.
+%
+% This socket is used by the tag key. It allows to switch between
+% the latex-tabs and the standard tags.
+% \begin{macrocode}
+%<*package>
+\socket_new:nn { tag/struct/tag }{1}
+\socket_new_plug:nnn { tag/struct/tag }{ latex-tags }
+ {
+ \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
+ \tl_gset:Ne \g_@@_struct_tag_tl { \seq_item:Nn\l_@@_tmpa_seq {1} }
+ \tl_gset:Ne \g_@@_struct_tag_NS_tl{ \seq_item:Nn\l_@@_tmpa_seq {2} }
+ \@@_check_structure_tag:N \g_@@_struct_tag_tl
+ }
+
+\socket_new_plug:nnn { tag/struct/tag }{ pdf-tags }
+ {
+ \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Ne\g_@@_role_tags_NS_prop{#1}}
+ \tl_gset:Ne \g_@@_struct_tag_tl { \seq_item:Nn\l_@@_tmpa_seq {1} }
+ \tl_gset:Ne \g_@@_struct_tag_NS_tl{ \seq_item:Nn\l_@@_tmpa_seq {2} }
+ \@@_role_get:VVNN \g_@@_struct_tag_tl\g_@@_struct_tag_NS_tl\l_@@_tmpa_tl\l_@@_tmpb_tl
+ \tl_gset:Ne \g_@@_struct_tag_tl {\l_@@_tmpa_tl}
+ \tl_gset:Ne \g_@@_struct_tag_NS_tl{\l_@@_tmpb_tl}
+ \@@_check_structure_tag:N \g_@@_struct_tag_tl
+ }
+\socket_assign_plug:nn { tag/struct/tag } {latex-tags}
+% \end{macrocode}
+
% \begin{macro}
% {
% label (struct-key),
@@ -1128,7 +1155,6 @@
% E (struct-key)
% }
% \begin{macrocode}
-%<*package>
\keys_define:nn { @@ / struct }
{
label .tl_set:N = \l_@@_struct_key_label_tl,
@@ -1152,10 +1178,7 @@
parent .default:n = {-1},
tag .code:n = % S property
{
- \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
- \tl_gset:Ne \g_@@_struct_tag_tl { \seq_item:Nn\l_@@_tmpa_seq {1} }
- \tl_gset:Ne \g_@@_struct_tag_NS_tl{ \seq_item:Nn\l_@@_tmpa_seq {2} }
- \@@_check_structure_tag:N \g_@@_struct_tag_tl
+ \socket_use:nn { tag/struct/tag }{#1}
},
title .code:n = % T property
{
@@ -1905,7 +1928,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2024-02-04} {0.98v}
+\ProvidesExplPackage {tagpdf-attr-code} {2024-02-22} {0.98w}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
@@ -1921,7 +1944,7 @@
% |\g_@@_attr_class_used_seq| will hold the attributes which have been used as
% class name.
% |\l_@@_attr_value_tl| is used to build the attribute array or key.
-% Everytime an attribute is used for the first time, and object is created
+% Every time an attribute is used for the first time, and object is created
% with its content, the name-object reference relation is stored in
% |\g_@@_attr_objref_prop|
% \begin{macrocode}
@@ -1933,9 +1956,9 @@
% \end{macrocode}
% \end{variable}
% \subsection{Commands and keys}
-% \begin{macro}{\@@_attr_new_entry:nn,newattribute (setup-key)}
+% \begin{macro}{\@@_attr_new_entry:nn,role/new-attribute (setup-key), newattribute (deprecated)}
% This allows to define attributes. Defined attributes
-% are stored in a global property. |newattribute| expects
+% are stored in a global property. |role/new-attribute| expects
% two brace group, the name and the content. The content typically
% needs an |/O| key for the owner. An example look like
% this.
@@ -1945,9 +1968,9 @@
% \begin{verbatim}
% \tagpdfsetup
% {
-% newattribute =
+% role/new-attribute =
% {TH-col}{/O /Table /Scope /Column},
-% newattribute =
+% role/new-attribute =
% {TH-row}{/O /Table /Scope /Row},
% }
% \end{verbatim}
@@ -1957,13 +1980,21 @@
\prop_gput:Nen \g_@@_attr_entries_prop
{\pdf_name_from_unicode_e:n{#1}}{#2}
}
-
+
+\cs_generate_variant:Nn \__tag_attr_new_entry:nn {ee}
\keys_define:nn { @@ / setup }
{
- newattribute .code:n =
+ role/new-attribute .code:n =
{
\@@_attr_new_entry:nn #1
}
+% \end{macrocode}
+% deprecated name
+% \begin{macrocode}
+ ,newattribute .code:n =
+ {
+ \@@_attr_new_entry:nn #1
+ },
}
% \end{macrocode}
% \end{macro}