summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-08-08 03:05:28 +0000
committerNorbert Preining <norbert@preining.info>2022-08-08 03:05:28 +0000
commitf1e79c3669f68804c471699badc56a4a33a23246 (patch)
tree5e6feae427931b2043e96c6c0867e02ab647c9da /macros/latex
parente56ef8f972de679101fb97ad8e180614d3fd4267 (diff)
CTAN sync 202208080305
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/tagpdf/README.md4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-backend.dtx8
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-checks.dtx22
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-code.pdfbin1209028 -> 1240587 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx13
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx9
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx8
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-roles.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-space.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-struct.dtx181
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-tree.dtx16
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-user.dtx34
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.dtx123
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.ins1
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.pdfbin488903 -> 492426 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.tex248
-rw-r--r--macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty2
17 files changed, 480 insertions, 197 deletions
diff --git a/macros/latex/contrib/tagpdf/README.md b/macros/latex/contrib/tagpdf/README.md
index 600220cc5c..222f51cb49 100644
--- a/macros/latex/contrib/tagpdf/README.md
+++ b/macros/latex/contrib/tagpdf/README.md
@@ -1,6 +1,6 @@
#tagpdf — A package to create tagged pdf
-Packageversion: 0.95
-Packagedate: 2022/05/29
+Packageversion: 0.96
+Packagedate: 2022/08/06
Author: Ulrike Fischer
## License
diff --git a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
index 8e11951780..fe68e70088 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.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2022-05-29} {0.95}
+\ProvidesExplFile {tagpdf-luatex.def} {2022-08-06} {0.96}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -157,8 +157,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.95", --TAGVERSION
- date = "2022-05-29", --TAGDATE
+ version = "0.96", --TAGVERSION
+ date = "2022-08-06", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
index 120de5eb0f..121e221611 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -60,9 +60,10 @@
% \begin{syntax}
% \cs{tag_get:n}\Arg{keyword}
% \end{syntax}
-% This is a generic command to retrieve data. Currently
+% This is a generic command to retrieve data for the current structure or
+% mc-chunk. Currently
% the only sensible values for the argument \meta{keyword}
-% are |mc_tag| and |struct_tag|.
+% are |mc_tag| and |struct_tag| and |struct_num|.
% \end{function}
%
% \section{Description of log messages}
@@ -294,7 +295,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-checks-code} {2022-08-06} {0.96}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
@@ -355,7 +356,14 @@
}
% \end{macrocode}
% \end{macro}
-% \subsection{Messages related to mc-chunks}
+% \subsection{Messages related to structures}
+% \begin{macro}{struct-unknown}
+% if for example a parent key value points to structure that doesn't exist (yet)
+% \begin{macrocode}
+\msg_new:nnn { tag } {struct-unknown}
+ { structure~with~number~#1~doesn't~exist\\ #2 }
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{struct-no-objnum}
% Should not happen \ldots
% \begin{macrocode}
@@ -463,7 +471,7 @@
% This retrieves some data.
% This is a generic command to retrieve data. Currently
% the only sensible values for the argument are |mc_tag|, |struct_tag|
-% and |struct-num|.
+% and |struct_num|.
% \begin{macrocode}
%<base>\cs_new:Npn \tag_get:n #1 { \use:c {@@_get_data_#1: } }
% \end{macrocode}
@@ -883,7 +891,7 @@
% \begin{macrocode}
\msg_new:nnn { tag / debug } {struct-begin}
{
- Struct~begin~#1~with~options:~\tl_to_str:n{#2}~[\msg_line_context:]
+ Struct~\tag_get:n{struct_num}~begin~#1~with~options:~\tl_to_str:n{#2}~[\msg_line_context:]
}
\msg_new:nnn { tag / debug } {struct-end}
{
diff --git a/macros/latex/contrib/tagpdf/tagpdf-code.pdf b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
index 5b8d418079..4def4f399b 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-code.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
index 003c2a2748..7881210a40 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2022-08-06} {0.96}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-debug-generic} {2022-08-06} {0.96}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
@@ -353,7 +353,7 @@
% for boxes produced for columns in that environment. Other streams
% may follow over time.
% \begin{macrocode}
-\cs_new:Npn\@@_add_missing_mcs:Nn #1 #2 {
+\cs_new_protected:Npn\@@_add_missing_mcs:Nn #1 #2 {
\vbadness \@M
\vfuzz \c_max_dim
\vbox_set_to_ht:Nnn #1 { \box_ht:N #1 } {
@@ -752,7 +752,7 @@
% {
% tag (mc-key),
% raw (mc-key),
-% alttext (mc-key),
+% alt (mc-key),
% actualtext (mc-key),
% label (mc-key),
% artifact (mc-key)
@@ -770,7 +770,7 @@
{
\tl_put_right:Nx \l_@@_mc_key_properties_tl { #1 }
},
- alttext .code:n = % Alt property
+ alt .code:n = % Alt property
{
\str_set_convert:Noon
\l_@@_tmpa_str
@@ -780,6 +780,7 @@
\tl_put_right:Nn \l_@@_mc_key_properties_tl { /Alt~< }
\tl_put_right:No \l_@@_mc_key_properties_tl { \l_@@_tmpa_str>~ }
},
+ alttext .meta:n = {alt=#1},
actualtext .code:n = % ActualText property
{
\str_set_convert:Noon
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
index 6d5e568e96..e001a4837a 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{implementation}
% The code is splitted into three parts: code shared by all engines,
@@ -86,7 +86,7 @@
% \begin{macrocode}
%<@@=tag>
%<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2022-08-06} {0.96}
{tagpdf - mc code only for the luamode }
%</luamode>
% \end{macrocode}
@@ -355,7 +355,7 @@
% {
% tag (mc-key),
% raw (mc-key),
-% alttext (mc-key),
+% alt (mc-key),
% actualtext (mc-key),
% label (mc-key),
% artifact (mc-key)
@@ -381,7 +381,7 @@
ltx.@@.func.store_mc_data(\@@_get_mc_abs_cnt:,"raw","#1")
}
},
- alttext .code:n = % Alt property
+ alt .code:n = % Alt property
{
\str_set_convert:Noon
\l_@@_tmpa_str
@@ -398,6 +398,7 @@
)
}
},
+ alttext .meta:n = {alt=#1},
actualtext .code:n = % Alt property
{
\str_set_convert:Noon
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
index 3ac4696ad0..0c6857c22a 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -101,7 +101,7 @@
% If there is no open chunk, it puts $-1$ on the stack (for debugging)
% \cs{tag_mc_begin_pop:n} removes a value from the stack. If it is different from
% $-1$ it opens a tag with it.
-% The reopened mc chunk looses info like the alttext for now.
+% The reopened mc chunk looses info like the alt text for now.
% \end{function}
%
% \begin{function}[pTF, EXP]{\tag_mc_if_in:}
@@ -141,7 +141,7 @@
% \verb+raw=/Alt (Hello)+ will insert an alternative Text.
% \end{function}
%
-% \begin{function}{alttext (mc-key)}
+% \begin{function}{alt (mc-key)}
% This key inserts an \texttt{/Alt} value in the property dictionary of the BDC operator.
% The value is handled as verbatim string, commands are not expanded.
% The value will be expanded first once.
@@ -174,7 +174,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2022-08-06} {0.96}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
diff --git a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
index 40122ccfb8..15c389e676 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -87,7 +87,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-roles-code} {2022-08-06} {0.96}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-space.dtx b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
index 7b6a75d8ea..8da502c709 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-space.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{documentation}
% \begin{function}{interwordspace (setup-key)}
@@ -64,7 +64,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-space-code} {2022-08-06} {0.96}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
index 103e337e9d..a476e3cf86 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.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -67,6 +67,18 @@
% A structure should be used only once,
% if the structure already has a parent a warning is issued.
% \end{function}
+% \begin{function}{\tag_struct_object_ref:n,\tag_struct_object_ref:e}
+% \begin{syntax}
+% \cs{tag_struct_object_ref:n}\Arg{struct number}
+% \end{syntax}
+% This is a small wrapper around |\pdf_object_ref:n| to retrieve the
+% object reference of the structure with the number \meta{struct number}.
+% This number can be retrieved and stored for the current structure
+% for example with \cs{tag_get:n}\Arg{struct_num}. Be aware that it can only
+% be used if the structure has already been created and that it doesn't check
+% if the object actually exists!
+% \end{function}
+%
% The following two functions are used to add annotations. They must be used
% together and with care to get the same numbers. Perhaps some improvements are needed
% here.
@@ -109,8 +121,21 @@
% \end{function}
% \begin{function}{label (struct-key)}
% This key sets a label by which
-% one can use the structure later in another structure.
-% Internally the label name will start with \texttt{tagpdfstruct-}.
+% one can refer to the structure. It is e.g.
+% used by \cs{tag_struct_use:n} (where a real label is actually not
+% needed as you can only use structures already defined), and by the
+% |ref| key (which can refer to future structures).
+% Internally the label name will start with \texttt{tagpdfstruct-} and it stores
+% the two attributs |tagstruct| (the structure number) and |tagstructobj| (the
+% object reference).
+% \end{function}
+% \begin{function}{parent (struct-key)}
+% By default a structure is added as kid to the currently active structure.
+% With the parent key one can choose another parent. The value is a structure number which
+% must refer to an already existing, previously created structure. Such a structure
+% number can for example be have been stored with \cs{tag_get:n}, but one can also use
+% a label on the parent structure and then use
+% \cs{ref_value:nn}|{tagpdfstruct-label}{tagstruct}| to retrieve it.
% \end{function}
% \begin{function}{title (struct-key),title-o (struct-key)}
% This keys allows to set the dictionary entry
@@ -119,7 +144,7 @@
% Commands are not expanded. |title-o| will expand the value once.
% \end{function}
%
-% \begin{function}{alttext (struct-key)}
+% \begin{function}{alt (struct-key)}
% This key inserts an \texttt{/Alt} value in the dictionary of structure object.
% The value is handled as verbatim string and hex encoded.
% The value will be expanded first once.
@@ -217,7 +242,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-struct-code} {2022-08-06} {0.96}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -274,10 +299,14 @@
% \end{variable}
%
% \begin{variable}{\g_@@_struct_stack_current_tl,\l_@@_struct_stack_parent_tmpa_tl}
-% The global variable will hold the current structure number.
+% The global variable will hold the current structure number. It is already
+% defined in \texttt{tagpdf-base}.
% The local temporary variable will hold the parent when we fetch it from the stack.
% \begin{macrocode}
-\tl_new:N \g_@@_struct_stack_current_tl
+%</package>
+%<base>\tl_new:N \g_@@_struct_stack_current_tl
+%<base>\tl_gset:Nn \g_@@_struct_stack_current_tl {\int_use:N\c@g_@@_struct_abs_int}
+%<*package>
\tl_new:N \l_@@_struct_stack_parent_tmpa_tl
% \end{macrocode}
% \end{variable}
@@ -617,6 +646,7 @@
% \end{macrocode}
% \end{macro}
+% \subsection{Output of the object}
% \begin{macro}{\@@_struct_get_dict_content:nN}
% This maps the dictionary content of a structure into a tl-var.
% Basically it does what |\pdfdict_use:n| does.
@@ -639,13 +669,32 @@
{ g_@@_struct_#1_prop }
{ ##1 }
{
- \c_space_tl/##1~\prop_item:cn{ g_@@_struct_#1_prop } { ##1 }
+ \c_space_tl/##1~
+% \end{macrocode}
+% Some keys needs the option to format the key, e.g. add brackets for an
+% array
+% \begin{macrocode}
+ \cs_if_exist_use:cTF {@@_struct_format_##1:e}
+ {
+ { \prop_item:cn{ g_@@_struct_#1_prop } { ##1 } }
+ }
+ {
+ \prop_item:cn{ g_@@_struct_#1_prop } { ##1 }
+ }
}
}
}
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\@@_struct_format_Ref:n}
+% Ref is an array, we store only the content to be able to extend it
+% so the formatting command adds the brackets:
+% \begin{macrocode}
+\cs_new:Nn\__tag_struct_format_Ref:n{[#1]}
+\cs_generate_variant:Nn\__tag_struct_format_Ref:n{e}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\@@_struct_write_obj:n}
% This writes out the structure object.
% This is done in the finish code, in the tree module and
@@ -658,7 +707,7 @@
\@@_struct_fill_kid_key:n { #1 }
\@@_struct_get_dict_content:nN { #1 } \l_@@_tmpa_tl
\exp_args:Nx
- \pdf_object_write:nx
+ \pdf_object_write_dict:nx
{ @@/struct/#1 }
{
\l_@@_tmpa_tl
@@ -744,7 +793,7 @@
\exp_args:Ne
\tl_tail:n
{
- \prop_item:cn {g_@@_struct_\g__tag_struct_stack_current_tl _prop}{S}
+ \prop_item:cn {g_@@_struct_\g_@@_struct_stack_current_tl _prop}{S}
}
}
%</package>
@@ -758,7 +807,7 @@
%<*base>
\cs_new:Npn \@@_get_data_struct_num:
{
- \int_use:N\c@g_@@_struct_abs_int
+ \g_@@_struct_stack_current_tl
}
%</base>
% \end{macrocode}
@@ -772,10 +821,11 @@
% {
% label (struct-key),
% stash (struct-key),
+% parent (struct-key),
% tag (struct-key),
% title (struct-key),
% title-o (struct-key),
-% alttext (struct-key),
+% alt (struct-key),
% actualtext (struct-key),
% lang (struct-key),
% ref (struct-key),
@@ -787,9 +837,26 @@
{
label .tl_set:N = \l_@@_struct_key_label_tl,
stash .bool_set:N = \l_@@_struct_elem_stash_bool,
+ parent .code:n =
+ {
+ \bool_lazy_and:nnTF
+ {
+ \prop_if_exist_p:c { g_@@_struct_\int_eval:n {#1}_prop }
+ }
+ {
+ \int_compare_p:nNn {#1}<{\c@g_@@_struct_abs_int}
+ }
+ { \tl_set:Nx \l_@@_struct_stack_parent_tmpa_tl { \int_eval:n {#1} } }
+ {
+ \msg_warning:nnxx { tag } { struct-unknown }
+ { \int_eval:n {#1} }
+ { parent~key~ignored }
+ }
+ },
+ parent .default:n = {-1},
tag .code:n = % S property
{
- \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Nn\g__tag_role_tags_NS_prop{#1}}
+ \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:No\g__tag_role_tags_NS_prop{#1}}
\tl_gset:Nx \g_@@_struct_tag_tl { \seq_item:Nn\l_@@_tmpa_seq {1} }
\tl_gset:Nx \g_@@_struct_tag_NS_tl { \seq_item:Nn\l_@@_tmpa_seq {2} }
\@@_check_structure_tag:N \g_@@_struct_tag_tl
@@ -829,7 +896,7 @@
{ T }
{ <\l_@@_tmpa_str> }
},
- alttext .code:n = % Alt property
+ alt .code:n = % Alt property
{
\str_set_convert:Noon
\l_@@_tmpa_str
@@ -841,6 +908,7 @@
{ Alt }
{ <\l_@@_tmpa_str> }
},
+ alttext .meta:n = {alt=#1},
actualtext .code:n = % ActualText property
{
\str_set_convert:Noon
@@ -860,18 +928,18 @@
{ Lang }
{ (#1) }
},
- ref .code:n = % Lang property
+% \end{macrocode}
+% Ref is an array, the brackets are added through the formatting command.
+% \begin{macrocode}
+ ref .code:n = % ref property
{
\tl_clear:N\l_@@_tmpa_tl
- \clist_map_inline:nn {#1}
+ \clist_map_inline:on {#1}
{
\tl_put_right:Nx \l_@@_tmpa_tl
{~\ref_value:nn{tagpdfstruct-##1}{tagstructobj} }
}
- \@@_prop_gput:cnx
- { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_prop }
- { Ref }
- { [\l_@@_tmpa_tl] }
+ \@@_struct_gput_data_ref:ee { \int_eval:n {\c@g_@@_struct_abs_int} } {\l_@@_tmpa_tl}
},
E .code:n = % E property
{
@@ -1044,6 +1112,7 @@
{ g_@@_struct_\int_eval:n { \c@g_@@_struct_abs_int }_prop }
{ Type }
{ /StructElem }
+ \tl_set:Nn \l_@@_struct_stack_parent_tmpa_tl {-1}
\keys_set:nn { @@ / struct} { #1 }
\@@_check_structure_has_tag:n { \int_eval:n {\c@g_@@_struct_abs_int} }
\tl_if_empty:NF
@@ -1051,13 +1120,19 @@
{
\@@_ref_label:en{tagpdfstruct-\l_@@_struct_key_label_tl}{struct}
}
- %get the potential parent from the stack:
- \seq_get:NNF
- \g_@@_struct_stack_seq
- \l_@@_struct_stack_parent_tmpa_tl
+% \end{macrocode}
+% The structure number of the parent is either taken from the stack or
+% has been set with the parent key.
+% \begin{macrocode}
+ \int_compare:nNnT { \l_@@_struct_stack_parent_tmpa_tl } = { -1 }
{
- \msg_error:nn { tag } { struct-faulty-nesting }
- }
+ \seq_get:NNF
+ \g_@@_struct_stack_seq
+ \l_@@_struct_stack_parent_tmpa_tl
+ {
+ \msg_error:nn { tag } { struct-faulty-nesting }
+ }
+ }
\seq_gpush:NV \g_@@_struct_stack_seq \c@g_@@_struct_abs_int
\seq_gpush:NV \g_@@_struct_tag_stack_seq \g_@@_struct_tag_tl
\tl_gset:NV \g_@@_struct_stack_current_tl \c@g_@@_struct_abs_int
@@ -1151,9 +1226,61 @@
}
}
}
+%</package>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\tag_struct_object_ref:n}
+% This is a command that allows to reference a structure. The argument is the
+% number which can be get for the current structure with |\tag_get:n{struct_num}|
+% TODO check if it should be in base too.
+% \begin{macrocode}
+%<*package>
+\cs_new:Npn \tag_struct_object_ref:n #1
+ {
+ \pdf_object_ref:n {@@/struct/#1}
+ }
+\cs_generate_variant:Nn \tag_struct_object_ref:n {e}
% \end{macrocode}
+%
% \end{macro}
%
+% \begin{macro}{\tag_struct_gput:nnn}
+% This is a command that allows to update the data of a structure.
+% The first argument is the
+% number of the structure, the second a keyword referring to a function,
+% the third the value. Currently the only keyword is \texttt{ref}
+% \begin{macrocode}
+\cs_new_protected:Npn \tag_struct_gput:nnn #1 #2 #3
+ {
+ \cs_if_exist_use:cF {@@_struct_gput_data_#2:nn}
+ { %warning??
+ \use_none:nn
+ }
+ {#1}{#3}
+ }
+\cs_generate_variant:Nn \tag_struct_gput:nnn {ene,nne}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_struct_gput_data_ref:nn}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_struct_gput_data_ref:nn #1 #2
+ % #1 receiving struct num, #2 list of object ref
+ {
+ \prop_get:cnN
+ { g_@@_struct_#1_prop }
+ {Ref}
+ \l_@@_tmpb_tl
+ \@@_prop_gput:cnx
+ { g_@@_struct_#1_prop }
+ { Ref }
+ { \quark_if_no_value:NF\l_@@_tmpb_tl { \l_@@_tmpb_tl\c_space_tl }#2 }
+ }
+\cs_generate_variant:Nn \@@_struct_gput_data_ref:nn {ee}
+% \end{macrocode}
+% \end{macro}
+
% \begin{macro}
% {
% \tag_struct_insert_annot:nn,
@@ -1192,7 +1319,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-attr-code} {2022-08-06} {0.96}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
index a8ea5b9b00..26124a3afd 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-tree-code} {2022-08-06} {0.96}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
@@ -285,7 +285,7 @@
\@@_tree_fill_parenttree:
}
\tl_put_right:NV \l_@@_parenttree_content_tl\g_@@_parenttree_objr_tl
- \pdf_object_write:nx { @@/tree/parenttree }
+ \pdf_object_write_dict:nx { @@/tree/parenttree }
{
/Nums\c_space_tl [\l_@@_parenttree_content_tl]
}
@@ -310,7 +310,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_tree_write_rolemap:
{
- \pdf_object_write:nx { @@/tree/rolemap }
+ \pdf_object_write_dict:nx { @@/tree/rolemap }
{
\pdfdict_use:n{g_@@_role/RoleMap_dict}
}
@@ -346,7 +346,7 @@
\l_@@_tmpa_tl
{
\pdf_object_new:nn { @@/tree/classmap }{ dict }
- \pdf_object_write:nx
+ \pdf_object_write_dict:nx
{ @@/tree/classmap }
{ \l_@@_tmpa_tl }
\@@_prop_gput:cnx
@@ -373,19 +373,19 @@
{
\pdfdict_if_empty:nF {g_@@_role/RoleMapNS_##1_dict}
{
- \pdf_object_write:nx {@@/RoleMapNS/##1}
+ \pdf_object_write_dict:nx {@@/RoleMapNS/##1}
{
\pdfdict_use:n {g_@@_role/RoleMapNS_##1_dict}
}
\pdfdict_gput:nnx{g_@@_role/Namespace_##1_dict}
{RoleMapNS}{\pdf_object_ref:n {@@/RoleMapNS/##1}}
}
- \pdf_object_write:nx{tag/NS/##1}
+ \pdf_object_write_dict:nx{tag/NS/##1}
{
\pdfdict_use:n {g_@@_role/Namespace_##1_dict}
}
}
- \pdf_object_write:nx {@@/tree/namespaces}
+ \pdf_object_write:nx {@@/tree/namespaces} %array
{
\prop_map_tokens:Nn \g_@@_role_NS_prop{\use_ii:nn}
}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-user.dtx b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
index 30f5abc3b4..607e949eed 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-user.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.95, released 2022-05-29}
+% \date{Version 0.96, released 2022-08-06}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -246,18 +246,20 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-user} {2022-08-06} {0.96}
{tagpdf - user commands}
%</header>
% \end{macrocode}
% \section{Setup and preamble commands}
% \begin{macro}{\tagpdfsetup}
% \begin{macrocode}
+%<base>\NewDocumentCommand \tagpdfsetup { m }{}
%<*package>
-\NewDocumentCommand \tagpdfsetup { m }
+\RenewDocumentCommand \tagpdfsetup { m }
{
\keys_set:nn { @@ / setup } { #1 }
}
+%</package>
% \end{macrocode}
% \end{macro}
%
@@ -265,15 +267,15 @@
% \section{Commands for the mc-chunks}
% \begin{macro}{\tagmcbegin,\tagmcend,\tagmcuse }
% \begin{macrocode}
+%<*base>
\NewDocumentCommand \tagmcbegin { m }
{
- \tag_mc_begin:n {#1}%\ignorespaces
+ \tag_mc_begin:n {#1}
}
\NewDocumentCommand \tagmcend { }
{
- %\if_mode_horizontal: \unskip \fi: %
\tag_mc_end:
}
@@ -281,7 +283,7 @@
{
\tag_mc_use:n {#1}
}
-
+%</base>
% \end{macrocode}
% \end{macro}
@@ -290,10 +292,12 @@
% importance for pdflatex as lualatex doesn't mind much if a mc tag is not
% correctly closed. Unlike the expl3 command it is not expandable.
% \begin{macrocode}
+%<*package>
\NewDocumentCommand \tagmcifinTF { m m }
{
\tag_mc_if_in:TF { #1 } { #2 }
}
+%</package>
% \end{macrocode}
% \end{macro}
%
@@ -303,6 +307,7 @@
% These are structure related user commands. There are direct wrapper around the
% expl3 variants.
% \begin{macrocode}
+%<*base>
\NewDocumentCommand \tagstructbegin { m }
{
\tag_struct_begin:n {#1}
@@ -317,6 +322,7 @@
{
\tag_struct_use:n {#1}
}
+%</base>
% \end{macrocode}
% \end{macro}
%
@@ -327,6 +333,7 @@
% This is a generic command for various show commands.
% It takes a keyval list, the various keys are implemented below.
% \begin{macrocode}
+%<*package>
\NewDocumentCommand\ShowTagging { m }
{
\keys_set:nn { @@ / show }{ #1}
@@ -559,6 +566,8 @@
\bool_new:N \l_@@_para_show_bool
\int_new:N \g_@@_para_begin_int
\int_new:N \g_@@_para_end_int
+\tl_new:N \l_@@_para_tag_tl
+\tl_set:Nn \l_@@_para_tag_tl { P }
% \end{macrocode}
% \end{macro}
%
@@ -576,6 +585,7 @@
{
paratagging .bool_set:N = \l_@@_para_bool,
paratagging-show .bool_set:N = \l_@@_para_show_bool,
+ paratag .tl_set:N = \l_@@_para_tag_tl
}
% \end{macrocode}
@@ -587,13 +597,13 @@
\bool_if:NT \l_@@_para_bool
{
\int_gincr:N \g_@@_para_begin_int
- \tag_struct_begin:n {tag=P}
+ \tag_struct_begin:n {tag=\l_@@_para_tag_tl}
\bool_if:NT \l_@@_para_show_bool
{ \tag_mc_begin:n{artifact}
\llap{\color_select:n{red}\tiny\int_use:N\g_@@_para_begin_int\ }
\tag_mc_end:
}
- \tag_mc_begin:n {tag=P}
+ \tag_mc_begin:n {tag=\l_@@_para_tag_tl}
}
}
\AddToHook{para/end}
@@ -649,6 +659,7 @@
}
}
}
+%</package>
% \end{macrocode}
% \begin{macro}
% {
@@ -658,8 +669,11 @@
% This two command switch para mode on and off. |\tagpdfsetup| could be used
% too but is longer.
% \begin{macrocode}
-\newcommand\tagpdfparaOn {\bool_set_true:N \l_@@_para_bool}
-\newcommand\tagpdfparaOff{\bool_set_false:N \l_@@_para_bool}
+%<base>\newcommand\tagpdfparaOn {}
+%<base>\newcommand\tagpdfparaOff{}
+%<*package>
+\renewcommand\tagpdfparaOn {\bool_set_true:N \l_@@_para_bool}
+\renewcommand\tagpdfparaOff{\bool_set_false:N \l_@@_para_bool}
% \end{macrocode}
% \end{macro}
%
diff --git a/macros/latex/contrib/tagpdf/tagpdf.dtx b/macros/latex/contrib/tagpdf/tagpdf.dtx
index 32b4100163..51d67e2ae9 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf.dtx
@@ -33,12 +33,23 @@
% \end{syntax}
% \end{function}
%
-% \begin{function}{ \tag_stop_group_begin:, \tag_stop_group_end:, \tag_stop: }
-% We need a command to stop tagging in some places.
-% This simply switches the two local booleans. The grouping commands
+% \begin{function}{ \tag_stop_group_begin:, \tag_stop_group_end:,
+% \tag_stop:, \tag_start:, \tag_stop:n, \tag_start:n }
+% We need commands to stop tagging in some places.
+% There simply switches the two local booleans. The grouping commands
% can be used to group the effect.
% \end{function}
%
+% \begin{function}{\tag_stop:n, \tag_start:n }%
+% \begin{syntax}
+% \cs{tag_stop:n}\Arg{label}
+% \cs{tag_start:n}\Arg{label}\\
+% \end{syntax}
+% This commands are intended as a pair. The start command
+% will only restart tagging if the previous stop command
+% with the same label actually stopped tagging.
+% \end{function}
+%
% \begin{function}{activate-space (setup-key)}
% |activate-space| activates the additional parsing needed for
% interword spaces. It is not documented, the parsing is currently
@@ -81,7 +92,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf} {2022-08-06} {0.96}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -107,10 +118,10 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-debug} {2022-08-06} {0.96}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
- \end{macrocode}
+% \end{macrocode}
%</debug>
% We map the internal module name \enquote{tag} to \enquote{tagpdf} in messages.
% \begin{macrocode}
@@ -148,7 +159,7 @@
% \end{macrocode}
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdf-base} {2022-08-06} {0.96}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
@@ -171,6 +182,50 @@
% \end{macrocode}
% \section{Temporary code}
% This is code which will be removed when proper support exists in LaTeX
+% \subsection{Faster object writing}
+%
+% \begin{macrocode}
+%<*package>
+\cs_if_free:NT \pdf_object_write_dict:nn
+ {
+ \cs_set_eq:NN \pdf_object_write_dict:nn \pdf_object_write:nn
+ }
+\cs_generate_variant:Nn \pdf_object_write_dict:nn {nx}
+
+\str_if_eq:VnT \c_sys_backend_str {pdftex}
+ {
+ \cs_if_free:NT \__pdf_backend_object_write_dict:nn
+ {
+ \cs_new_protected:Npn \__pdf_backend_object_write_dict:nn #1#2
+ {
+ \tex_immediate:D \tex_pdfobj:D
+ useobjnum ~
+ \int_use:c
+ { c__pdf_backend_object_ \tl_to_str:n {#1} _int }
+ { << ~ \exp_not:n {#2} ~ >> }
+ }
+ \cs_set_eq:NN \pdf_object_write_dict:nn \__pdf_backend_object_write_dict:nn
+ }
+ }
+
+\str_if_eq:VnT \c_sys_backend_str {luatex}
+ {
+ \cs_if_free:NT \__pdf_backend_object_write_dict:nn
+ {
+ \cs_new_protected:Npn \__pdf_backend_object_write_dict:nn #1#2
+ {
+ \tex_immediate:D \tex_pdfextension:D obj ~
+ useobjnum ~
+ \int_use:c
+ { c__pdf_backend_object_ \tl_to_str:n {#1} _int }
+ { << ~ \exp_not:n {#2} ~ >> }
+ }
+ \cs_set_eq:NN \pdf_object_write_dict:nn \__pdf_backend_object_write_dict:nn
+ }
+ }
+%</package>
+% \end{macrocode}
+
% \subsection{a LastPage label}
% See also issue \#2 in Accessible-xref
% \begin{macro}{\@@_lastpagelabel:}
@@ -225,6 +280,7 @@
% \begin{variable}
% {
% \l_@@_tmpa_tl,
+% \l_@@_tmpb_tl
% \l_@@_tmpa_str,
% \l_@@_tmpa_prop,
% \l_@@_tmpa_seq,
@@ -237,6 +293,7 @@
% A few temporary variables
% \begin{macrocode}
\tl_new:N \l_@@_tmpa_tl
+\tl_new:N \l_@@_tmpb_tl
\str_new:N \l_@@_tmpa_str
\prop_new:N \l_@@_tmpa_prop
\seq_new:N \l_@@_tmpa_seq
@@ -333,9 +390,11 @@
\cs_generate_variant:Nn \pdffile_embed_stream:nnn {nxx,oxx}
\cs_generate_variant:Nn \prop_gput:Nnn {Nxx,Nen}
\cs_generate_variant:Nn \prop_put:Nnn {Nxx}
+\cs_generate_variant:Nn \prop_item:Nn {No}
\cs_generate_variant:Nn \ref_label:nn { nv }
\cs_generate_variant:Nn \seq_set_split:Nnn{Nne}
\cs_generate_variant:Nn \str_set_convert:Nnnn {Nonn, Noon, Nnon }
+\cs_generate_variant:Nn \clist_map_inline:nn {on}
% \end{macrocode}
% \section{Setup label attributes}
@@ -444,10 +503,16 @@
% \end{macro}
%
% \section{General tagging commands}
-
-% \begin{macro}{ \tag_stop_group_begin:, \tag_stop_group_end: }
-% We need a command to stop tagging in some places.
+%
+% \begin{macro}{\tag_stop_group_begin:,
+% \tag_stop_group_end:,
+% \tag_stop:,\tag_start:,
+% \tag_stop:n,\tag_start:n}
+% We need commands to stop tagging in some places.
% This simply switches the two local booleans.
+% In some cases tagging should only restart, if
+% it actually was stopped before. For this it is possible
+% to label a stop.
% \begin{macrocode}
\cs_new_protected:Npn \tag_stop_group_begin:
{
@@ -456,14 +521,49 @@
\bool_set_false:N \l_@@_active_mc_bool
}
\cs_set_eq:NN \tag_stop_group_end: \group_end:
-\cs_new_protected:Npn \tag_stop:
+\cs_set_protected:Npn \tag_stop:
{
\bool_set_false:N \l_@@_active_struct_bool
\bool_set_false:N \l_@@_active_mc_bool
}
+\cs_set_protected:Npn \tag_start:
+ {
+ \bool_set_true:N \l_@@_active_struct_bool
+ \bool_set_true:N \l_@@_active_mc_bool
+ }
+\prop_new:N\g_@@_state_prop
+\cs_set_protected:Npn \tag_stop:n #1
+ {
+ \tag_if_active:TF
+ {
+ \bool_set_false:N \l_@@_active_struct_bool
+ \bool_set_false:N \l_@@_active_mc_bool
+ \prop_gput:Nnn \g_@@_state_prop { #1 }{ 1 }
+ }
+ {
+ \prop_gremove:Nn \g_@@_state_prop { #1 }
+ }
+ }
+\cs_set_protected:Npn \tag_start:n #1
+ {
+ \prop_gpop:NnN \g_@@_state_prop {#1}\l_@@_tmpa_tl
+ \quark_if_no_value:NF \l_@@_tmpa_tl
+ {
+ \bool_set_true:N \l_@@_active_struct_bool
+ \bool_set_true:N \l_@@_active_mc_bool
+ }
+ }
+%</package>
+%<*base>
+\cs_new_protected:Npn \tag_stop:{}
+\cs_new_protected:Npn \tag_start:{}
+\cs_new_protected:Npn \tag_stop:n{}
+\cs_new_protected:Npn \tag_start:n{}
+%</base>
% \end{macrocode}
% \end{macro}
%
+%
% \section{Keys for tagpdfsetup}
% TODO: the log-levels must be sorted
@@ -484,6 +584,7 @@
% perhaps move to some other place, now that it is better separated.
% |no-struct-dest| allows to suppress structure destinations.
% \begin{macrocode}
+%<*package>
\keys_define:nn { @@ / setup }
{
activate-space .bool_gset:N = \g_@@_active_space_bool,
diff --git a/macros/latex/contrib/tagpdf/tagpdf.ins b/macros/latex/contrib/tagpdf/tagpdf.ins
index 54809f67c1..60c0803cbf 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.ins
+++ b/macros/latex/contrib/tagpdf/tagpdf.ins
@@ -77,6 +77,7 @@ and all files in that bundle must be distributed together.
\from{tagpdf-mc-shared.dtx}{base}
\from{tagpdf-struct.dtx}{base}
\from{tagpdf-checks.dtx}{base}
+ \from{tagpdf-user.dtx}{base}
}
}
diff --git a/macros/latex/contrib/tagpdf/tagpdf.pdf b/macros/latex/contrib/tagpdf/tagpdf.pdf
index d679c20913..ff623f0fa9 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf.tex b/macros/latex/contrib/tagpdf/tagpdf.tex
index 70a771de2b..977e32cf32 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.tex
+++ b/macros/latex/contrib/tagpdf/tagpdf.tex
@@ -4,8 +4,8 @@
\DocumentMetadata{pdfversion=2.0,lang=en-UK,testphase=phase-II}
\makeatletter
-\def\UlrikeFischer@package@version{0.95}
-\def\UlrikeFischer@package@date{2022-05-29}
+\def\UlrikeFischer@package@version{0.96}
+\def\UlrikeFischer@package@date{2022-08-06}
\makeatother
\documentclass[DIV=12,parskip=half-,bibliography=totoc]{scrartcl}
@@ -14,10 +14,10 @@
\usepackage{unicode-math}
\setmainfont{Heuristica}
-\usepackage{microtype}
+\usepackage[nopatch]{microtype}
\makeatletter
% see https://github.com/schlcht/microtype/issues/8
-\patchcmd{\MT@get@prot}{\noindent}{\RawNoindent}{}{\fail}
+%\patchcmd{\MT@get@prot}{\noindent}{\RawNoindent}{}{\fail}
\makeatother
\usepackage{scrlayer-scrpage}
@@ -99,7 +99,7 @@
\tagstructbegin{tag=Title}
\tagmcbegin{tag=Title}
-\begin{center}\let\thanks\par
+\begin{center}%\let\thanks\par
\makeatletter
\usekomafont{title}{\huge \@title \par}
@@ -127,7 +127,8 @@ You need a very current \LaTeX{} format.
You need a very current L3 programming layer.
You need the new \LaTeX{} PDF management bundle.
-This package is incomplete, experimental and quite probably contains bugs.
+This package is incomplete, experimental and quite probably contains bugs. It is in parts
+quite slow as the code prefers readability over speed.
At some time it will disappear when the code has been integrated into the \LaTeX{} format.
This package can change in an incompatible way.
@@ -147,62 +148,30 @@ Issues, comments, suggestions should be added as issues to the github tracker:
\tableofcontents
-\section{Preface to version 0.94}
-
-In this version a small package, \pkg{tagpdf-base} has been added. It provides
-no-op versions of the main expl3 user commands for packages that want to support
-tagging but can't be sure if the \pkg{tagpdf} package has been loaded.
-
-
-
-\section{Preface to version 0.93}
-The main change in the package itself in this version is the support for structure destinations.
-This is a new type of destinations in \PDF~2.0.
-For pdftex and luatex this requires new binaries. They will be included
-in texlive 2022, miktex already has the new pdftex, the new luatex will probably follow soon.
-
-Beside this mostly some clean up and bug fixes has been done.
-
-A more important step will be done in \LaTeX{} itself in the next dev-release: The command \cs{DocumentMetadata} will be
-added to the format and will take over the role of \cs{DeclareDocumentMetadata} from \pkg{pdfmanagement-testphase} and additionally
-will also load the pdf management code. This will simplify the documents as it will no longer be needed to load
-a package.
-
-
-
-\section{Preface to version 0.92}
-
-In this version support for page breaks in pdftex has been added. As described in section~\ref{sec:splitpara},
-tagging markers must be added by \emph{page}. That means that a paragraph that goes over two pages must get an end
-marker at the end on the first page and a new begin marker on the next page.
-
-With lualatex that is rather easy to ensure, with pdflatex it requires quite sophisticated code.
-The method is described in Frank Mittelbach's talk at TUG~2021
-\enquote{Taming the beast — Advances in paragraph tagging with pdfTeX and XeTeX}
-\url{https://youtu.be/SZHIeevyo3U?t=19551}. The new code requires a new version of the pdfmanagement-testphase package.
-
-Please check also section~\ref{sec:splitpara} for possible pitfalls.
-
-Also new in this version is the handling of header and footer: they will now be tagged as artifacts automatically.
-See section~\ref{sec:header-footer}.
\section{Introduction}
-Since many year the creation of accessible \PDF{}-files with \LaTeX\ which conform to the PDF/UA standard has been on the agenda of \TeX-meetings. Many people agree that this is important and Ross Moore has done quite some work on it. There is also a TUG-mailing list and a webpage \parencite{tugaccess} dedicated to this theme.
+Since many years the creation of accessible \PDF{}-files with \LaTeX\ which conform to the PDF/UA standard has been on the agenda of \TeX-meetings. Many people agree that this is important and Ross Moore has done quite some work on it. There is also a TUG-mailing list and a webpage \parencite{tugaccess} dedicated to this theme.
+
+But in my opinion missing were means to \emph{experiment} with tagging and accessibility. Means to try out, how difficult it is to tag some structures, means to try out, how much tagging is really needed (standards and validators don't need to be right \ldots), means to test what else is needed so that a \PDF{} works e.g. with a screen reader. Without such experiments it is imho quite difficult to get a feeling about what has to be done, which kernel changes are needed, how packages should be adapted.
-But in my opinion missing are means to \emph{experiment} with tagging and accessibility. Means to try out, how difficult it is to tag some structures, means to try out, how much tagging is really needed (standards and validators don't need to be right \ldots), means to test what else is needed so that a \PDF{} works e.g. with a screen reader. Without such experiments it is imho quite difficult to get a feeling about what has to be done, which kernel changes are needed, how packages should be adapted.
-This package tries to close this gap by offering \emph{core} commands to tag a \PDF{}%
+This package were developped to close this gap by offering \emph{core} commands to tag a \PDF{}%
\footnote{In case you don't know what this means: there will be some explanations later on.}.
+My hope was that the knowledge gained by the use of this package will at the end allow to decide if and how code to do tagging should be part of the \LaTeX\ kernel.
-My hope is that the knowledge gained by the use of this package will at the end allow to decide if and how code to do tagging should be part of the \LaTeX\ kernel.
-The package does not patch commands from other packages. It is also not an aim of the package to develop such patches. While at the end changes to various commands in many classes and packages will be needed to get tagged \PDF{} files -- and the examples accompanying the package try (or will try) to show various strategies -- these changes should in my opinion be done by the class, package and document writers themselves using a sensible API provided by the kernel and not by some external package that adds patches everywhere and would need constant maintenance -- one only need to look at packages like tex4ht or bidi or hyperref to see how difficult and sometimes fragile this is.
+The code has been written with the goal to extend \LaTeX{} itself.
+It therefore quite does not patch commands from other packages and is also not an aim of the package to develop such patches. While at the end changes to various commands in many classes and packages will be needed to get tagged \PDF{} files -- and the examples accompanying the package try (or will try) to show various strategies -- these changes should in my opinion be done by the class, package and document writers themselves using a sensible API provided by the kernel and not by some external package that adds patches everywhere and would need constant maintenance -- one only need to look at packages like tex4ht or bidi or hyperref to see how difficult and sometimes fragile this is.
-So this package deliberately concentrates on the basics -- and this already quite a lot, there are much more details involved as I expected when I started.
-I'm sure that it has bugs. Bugs reports, suggestions and comments can be added to the issue tracker on github. \url{https://github.com/u-fischer/tagpdf}.
+The package is now a part of the Tagged PDF project and triggered already various changes in the LaTeX kernel and the engines: There is a new PDF management,
+the new para hooks allows to automatically tag paragraphs, after changes in the output routine
+page breaks and header and footer are handled correctly, the engines support
+now structure destinations.
+
+I'm sure that it still has bugs. Bugs reports, suggestions and comments can be added to the issue tracker on github. \url{https://github.com/u-fischer/tagpdf}.
Please also check the github site for new examples and improvements.
@@ -215,7 +184,9 @@ So the name of the package is a bit wrong. As excuse I can only say that it is s
\subsection{Engines and modes}
-The package works currently with pdflatex and lualatex. First steps have been done to also enable support for xelatex and the latex-dvips-route; but this isn't yet much tested.
+The package theoretically with all engines,
+But the xelatex and the latex-dvips-route are not much tested and they also don't support
+real space glyphs. lualatex is the most powerful and safe modus, but pdflatex works ok too.
The package has two modes: the \emph{generic mode} which should work in theory with every engine and the \emph{lua mode} which works only with lualatex.
@@ -223,7 +194,8 @@ I implemented the generic mode first. Mostly because my tex skills are much bett
While the generic mode is not bad and I spent quite some time to get it working I nevertheless think that the lua mode is the future and the only one that will be usable for larger documents. \PDF{} is a page orientated format and so the ability of luatex to manipulate pages and nodes after the \TeX-processing is really useful here. Also with luatex characters are normally already given as unicode.
-The package uses quite a lot labels (in generic mode more than with luamode). At the begin it relied on the \pkg{zref} package, but switched now to a new experimental implementation for labels. The drawback of the new method is that they don't give yet good rerun messages if they have changed. I advise to use the \pkg{rerunfilecheck} package as a intermediate work-around.
+The package uses quite a lot labels (in generic mode more than with luamode). At the begin it relied on the \pkg{zref} package, but switched now to a new experimental implementation for labels. The drawback of the new method is that they don't give yet good rerun messages if they have changed. I advise to use the \pkg{rerunfilecheck} package as a intermediate work-around and when using pdflatex compile
+at best at least once or twice more often then normal.
\subsection{References and target PDF version}
@@ -283,14 +255,15 @@ Feedback, contribuations and corrections are welcome!
\end{tcolorbox}
-All examples should use the \cs{tagpdfsetup} key \PrintKeyName{uncompress} described in the next section so that uncompressed \PDF{} are created and the internal objects and structures can be inspected and -- hopefully soon -- be compared by the l3build checks.%
+All examples should use the \cs{DocumentMetadata} key \PrintKeyName{uncompress}
+so that uncompressed \PDF{} are created and the internal objects and structures can be inspected and -- hopefully soon -- be compared by the l3build checks.%
\section{Changes}
\subsection{Changes in 0.3}
-In this version I improved the handling of alternative and actual text. See section~\ref{sec:alttext}. This change meant that the package relied on the module \texttt{l3str-convert}.
+In this version I improved the handling of alternative and actual text. See section~\ref{sec:alt}. This change meant that the package relies on the module \texttt{l3str-convert}.
I no longer try to (pdf-)escape the tag names: it is a bit unclear how to do it at best with luatex. This will perhaps later change again.
@@ -307,7 +280,7 @@ I added code to add \enquote{real} space glyphs to the \PDF{}, see section \ref{
\subsection{Changes in 0.6}
-\textbf{Breaking change!} The attributes used in luamode to mark the MC-chunks are no longer set globally. I thought that global attribute would make it easier to tag, but it only leads to problem when e.g. header and footer are inserted. So from this version on the attributes are set locally and the effect of a \verb+\tagmcbegin+ ends with the current group. This means that in some cases more \verb+\tagmcbegin+ are needed and this affected some of the examples, e.g. the patching commands for sections with KOMA. On the other side it means that quite often one can omit the \verb+\tagmcend+ command.
+\textbf{Breaking change!} The attributes used in luamode to mark the MC-chunks are no longer set globally. I thought that global attributes would make it easier to tag, but it only leads to problem when e.g. header and footer are inserted. So from this version on the attributes are set locally and the effect of a \verb+\tagmcbegin+ ends with the current group. This means that in some cases more \verb+\tagmcbegin+ are needed and this affected some of the examples, e.g. the patching commands for sections with KOMA. On the other side it means that quite often one can omit the \verb+\tagmcend+ command.
\subsection{Changes in version 0.61}
@@ -401,7 +374,7 @@ works also if tagging is not active.
\begin{itemize}
\item support for page breaks in pdftex has been added, see section~\ref{sec:splitpara},
-This requires a new version of the pdfmanagement-testphase package.
+
\item header and footer are tagged as artifacts automatically, see section~\ref{sec:header-footer}.
@@ -410,6 +383,9 @@ will now expand once.
\end{itemize}
+
+
+
\subsection{Changes in version 0.93}
\begin{itemize}
@@ -417,8 +393,12 @@ will now expand once.
has been added. This allow e.g. to add a css-file which is be used if the \PDF\ is converted to
html.
-\item First steps have been done to adapt the package to planed changes in \LaTeX{}: The command \cs{DocumentMetadata} will be
-added to the format and will take over the role of \cs{DeclareDocumentMetadata} from \pkg{pdfmanagement-testphase}.
+\item First steps have been done to adapt the package to planed changes in \LaTeX{}:
+The command \cs{DocumentMetadata} will be
+added to the format and will take over the role of \cs{DeclareDocumentMetadata}
+from \pkg{pdfmanagement-testphase} and additionally
+will also load the pdf management code. This will simplify the documents
+as it will no longer be needed to load the package.
\item The package has now support for \enquote{structure destinations}.
This is a new type of destinations in \PDF~2.0.
@@ -429,6 +409,36 @@ in texlive 2022, miktex already has the new pdftex, the new luatex will probably
\end{itemize}
+\subsection{Changes in version 0.94}
+
+In this version a small package, \pkg{tagpdf-base} has been added. It provides
+no-op versions of the main expl3 user commands for packages that want to support
+tagging but can't be sure if the \pkg{tagpdf} package has been loaded.
+
+\subsection{Changes in version 0.95}
+
+Small bug fixes.
+
+\subsection{Changes in version 0.96}
+
+\begin{itemize}
+\item The \texttt{alttext} key has been renamed to \texttt{alt}, the other key name exists as alias.
+
+\item The new command |\tag_struct_object_ref:n| allows to
+ create the object reference of a structure.
+
+\item a new key \texttt{parent} has been added
+ to allow structures to choose their parent structure.
+
+\item a new option \texttt{paratag} allows to change the tag name used for the
+ automatically tagged paragraphs.
+
+\item the commands |\tag_start:|, |\tag_stop:n| and |\tag_start:n| allow
+ to stop and start tagging for example in trial typesetting.
+
+\item Small bug fixes.
+\end{itemize}
+
\subsection{Proof of concept: the tagging of the documentation itself}
Starting with version 0.6 the documentation itself has been tagged. The tagging wasn't (and isn't) in no way perfect. The validator from Adobe didn't complain, but PAX3 wanted alternative text for all links (no idea why) and so I put everywhere simple text like \enquote{link} and \enquote{ref}. The links to footnotes gave warnings, so I disabled them. I used types from the \PDF{} version 1.7, mostly as I have no idea what should be used for code in 2.0. Margin notes were simply wrong \ldots
@@ -443,36 +453,25 @@ Be aware that to create the tagged version a current lualatex-dev and a current
\tagpdfparaOff
-\tagstructbegin{tag=Figure,alttext=PAC3 report,attribute=bbox}\tagmcbegin{tag=Figure}
+\tagstructbegin{tag=Figure,alt=PAC3 report,attribute=bbox}\tagmcbegin{tag=Figure}
\includegraphics{pac3}
\tagmcend\tagstructend
\tagpdfparaOn
-\section{Setup}
-
-The package requires the new PDF management. With a current version of \pkg{pdfmanagement-testphase} it can be loaded and
-activated like this:
-
-\begin{lstlisting}
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata
- {
- testphase = tagpdf, % load
- activate = tagging % activate and create the document structure
- }
-\documentclass{article}
-\begin{document}
-some text
-\end{document}
-\end{lstlisting}
+\section{Loading}
-With \LaTeX{} 2022-06-01 (or a current \LaTeX-dev) the call will be simpler
+The package requires the new PDF management. With a current \LaTeX{} (2022-06-01 or newer)
+the PDF management is loaded if you use the \cs{DocumentMetadata} command before \cs{documentclass}.
+The \texttt{tagpdf} package can then be loaded and activated by using the \texttt{testphase} key. The exact behaviour of
+the \texttt{testphase} key is documented in \texttt{documentmetadata-support-doc.pdf} which
+is part of the \texttt{latex-lab} bundle.
\begin{lstlisting}
\DocumentMetadata
{
- testphase = tagpdf, % load + activate
+ % testphase = phase-I, % tagging without paragraph tagging
+ testphase = phase-II % tagging with paragraph tagging and other new stuff.
}
\documentclass{article}
\begin{document}
@@ -482,14 +481,18 @@ some text
\minisec{Activation needed!}
+The package can also be loaded normally with |\usepackage| (but it is
+still required to use \cs{DocumentMetadata} to load the pdfmanagement) but
+it will then -- apart from loading more packages and defining a lot of things -- not do much. You will have to \emph{activate} it with \verb+\tagpdfsetup+.
-When the package is loaded it will -- apart from loading more packages and defining a lot of things -- not do much. You will have to activate it with \verb+\tagpdfsetup+ or as shown above in \verb+\DeclareDocumentMetadata+/\verb+\DocumentMetadata+.
+The pdfmanagement loaded with \cs{DocumentMetadata} will in any case load \texttt{tagpdf-base} a
+small package that provides no-op versions of the main tagging commands.
Most commands do nothing if tagging is not activated, but in case a test is needed a command (with the usual p,T,F variants) is provided:
\begin{docCommand}{tag_if_active:TF}{}\end{docCommand}
-The check is true only if \emph{everything} is activated. In all other cases (also if tagging has been stopped locally) it will be false.
+The check is true only if \emph{everything} is activated. In all other cases (including if tagging has been stopped locally) it will be false.
\subsection{Modes and package options}
@@ -555,6 +558,8 @@ That's a debug option, it helps in lua mode to see where space glyph will be ins
\item[\PrintKeyName{paratagging-show}] Boolean. This activate/deactivates small red numbers in the places where the paratagging hook code is used.
+\item[\PrintKeyName{paratag}] String. This key changes the tag used by the paratagging code. The default tag is \texttt{P}. A useful local setting here can be \texttt{NonStruct}, which creates a structure \enquote{without meaning}.
+
\item[\PrintKeyName{tabsorder}]
Choice key, possible values are \PrintKeyName{row}, \PrintKeyName{column}, \PrintKeyName{structure}, \PrintKeyName{none}. This decides if a \verb+/Tabs+ value is written to the dictionary of the page objects. Not really needed for tagging itself, but one of the things you probably need for accessibility checks. So I added it. Currently the tabsorder is the same for all pages. Perhaps this should be changed \ldots.
@@ -625,7 +630,7 @@ To tag a \PDF{} three tasks must be carried out:
\tagpdfparaOff
-\tagstructbegin{tag=Figure,alttext={Illustration of page stream with marked content},attribute=bbox}%
+\tagstructbegin{tag=Figure,alt={Illustration of page stream with marked content},attribute=bbox}%
\tagmcbegin{tag=Figure}%
\begin{tikzpicture}[baseline=(a.north),node distance=2pt,remember picture]
\node(start){\ldots~\ldots~\ldots};
@@ -645,7 +650,7 @@ To tag a \PDF{} three tasks must be carried out:
\tagpdfparaOff
\newlength\ydistance\setlength\ydistance{-0.8cm}
-\tagstructbegin{tag=Figure,alttext={Illustration of structure},attribute=bbox}%
+\tagstructbegin{tag=Figure,alt={Illustration of structure},attribute=bbox}%
\tagmcbegin{tag=Figure}%
\begin{tikzpicture}[remember picture,baseline=(root.north)]
@@ -847,21 +852,21 @@ The key-val list understands the following keys:
\item[\PrintKeyName{label}]
This key sets a label by which you can call the marked content later in another structure (if it has been stashed with the previous key). Internally the label name will start with \texttt{tagpdf-}.
- \item[\PrintKeyName{alttext}]
- This key inserts an \texttt{/Alt} value in the property dictionary of the BDC operator. See section~\ref{sec:alttext}. The value is handled as verbatim string, commands are not expanded but the value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed).
+ \item[\PrintKeyName{alt}]
+ This key inserts an \texttt{/Alt} value in the property dictionary of the BDC operator. See section~\ref{sec:alt}. The value is handled as verbatim string, commands are not expanded but the value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed).
That means that you can do something like in the following listing
and it will insert \verb+\frac{a}{b}+ (hex encoded) in the \PDF{}.
\begin{lstlisting}
\newcommand\myalttext{\frac{a}{b}}
- \tagmcbegin{tag=P,alttext=\myalttext}
+ \tagmcbegin{tag=P,alt=\myalttext}
\end{lstlisting}
\item[\PrintKeyName{actualtext}]
- This key inserts an \texttt{/ActualText} value in the property dictionary of the BDC operator. See section~\ref{sec:alttext}. The value is handled as verbatim string, commands are not expanded but the value will be expanded first once (so works like the key \texttt{actualtext-o} in previous versions which has been removed).
+ This key inserts an \texttt{/ActualText} value in the property dictionary of the BDC operator. See section~\ref{sec:alt}. The value is handled as verbatim string, commands are not expanded but the value will be expanded first once (so works like the key \texttt{actualtext-o} in previous versions which has been removed).
That means that you can do something like in the following listing and and it will insert \verb+X+ (hex encoded) in the \PDF{}.
@@ -936,7 +941,10 @@ In \emph{lua mode} it tests if the mc-attribute is currently unset. You can't te
\begin{docCommand}{tag_get:n}{\marg{key word}}\end{docCommand}
-This command give back some variables. Currently the only working key words are \verb+mc\_tag+, \verb+struct\_tag+ and \verb+struct\_num+. The last returns a number works also if only \pkg{tagpdf-base} has been loaded.
+This command give back some variables. Currently the only working key words are \verb+mc_tag+, \verb+struct_tag+ and \verb+struct_num+. The last returns a number and works also if only \pkg{tagpdf-base} has been loaded, but then doesn't give the same output: if \pkg{tagpdf} is loaded and tagging is active, \verb+struct_num+ gives the number of currently
+active structure, so it reverts to the parent number if a structure is closed. If only \pkg{tagpdf-base} is loaded
+nesting of structure is not tracked and so the command gives back the number of the last structure that has been created.
+
\subsubsection{Luamode: global or not global -- that is the question}\label{sec:global-local}
@@ -994,7 +1002,7 @@ the \emph{second} page will be marked as artifact. The following figure shows ho
like.
\tagpdfparaOff
-\tagstructbegin{tag=Figure,alttext=Show tags of examples,attribute=bbox}\tagmcbegin{tag=Figure}
+\tagstructbegin{tag=Figure,alt=Show tags of examples,attribute=bbox}\tagmcbegin{tag=Figure}
\includegraphics{global-ex}
\tagmcend\tagstructend
@@ -1025,7 +1033,7 @@ the needed code.
\begin{figure}
\tagpdfparaOff
-\tagstructbegin{tag=Figure,alttext={Illustration of link annotation structure},attribute=bbox}\tagmcbegin{tag=Figure}
+\tagstructbegin{tag=Figure,alt={Illustration of link annotation structure},attribute=bbox}\tagmcbegin{tag=Figure}
\ExplSyntaxOn
\tag_stop_group_begin:
\ExplSyntaxOff
@@ -1161,7 +1169,7 @@ If this is really the way to go one would need some script to add the mark-up as
But I'm not sure that this is the best way to do math. It looks rather odd that a document should have to tell a screen reader in such detail how to read an equation. It would be much more efficient, sensible and flexible if a complete representation of the equation in mathML could be stored in the \PDF{} and the task how to read this aloud delegated to the screen reader. As \PDF{}~2.0 introduced associated files it is probable that this will be the way to go but more investigations are needed here.
-See also section~\ref{sec:alttext} for some more remarks and tests.
+See also section~\ref{sec:alt} for some more remarks and tests.
\subsubsection{Split paragraphs}\label{sec:splitpara}
@@ -1186,14 +1194,18 @@ Pellentesque scelerisque
sit amet, lacus.\tagmcend
\end{lstlisting}
-Starting with version 0.91 there is code which tries to resolve this problem. Basically it works like this: every mc-command
+Starting with version 0.92 there is code which tries to resolve this problem. Basically it works like this: every mc-command
issues a mark command (actually two slightly different). When the page is built in the output routine this mark commands are inspected
and from them \LaTeX{} can deduce if there is a mc-chunk which must be closed or reopened.
+The method is described in Frank Mittelbach's talk at TUG~2021
+\enquote{Taming the beast — Advances in paragraph tagging with pdfTeX and XeTeX}
+\url{https://youtu.be/SZHIeevyo3U?t=19551}.
+
Please note
\begin{itemize}
-\item The code requires the pdfmanagement-testphase version v0.95i.
+\item The code requires a pdfmanagement-testphase version v0.95i or newer.
\item Typically you will need more compilations than previously, don't rely on the rerun messages, but if something looks wrong
rerun.
\item The code relies on that related |\tagmcbegin| and |\tagmcend| are in the same boxing level. If one is in a box (which hides the marks) and the other in the main galley, things will go wrong.
@@ -1206,12 +1218,16 @@ rerun.
Another feature that emerged from the \LaTeX{} tagged PDF project are hooks at the begin and end of paragraphs.
\pkg{tagpdf} makes use of these hooks to tag paragraphs. This can be activated/deactivated (also locally) with
-options of \cs{tagpdfsetup} or with the two commands above. \emph{This is very experimental and it requires a new \LaTeX!}
+options of \cs{tagpdfsetup} or with the two commands above.
The automatic tagging require that for every begin of a paragraph with the begin hook code
there a corresponding end with the closing hook code. This can fail, e.g if a |vbox| doesn't correctly issue a |\par| at the end.
-If this happens the tagging structure can get every confused. It is therefore needed to check the structure carefully as currently
-no checks are implemented to check this automatically.
+If this happens the tagging structure can get every confused. At the end of the document \pkg{tagpdf} checks if
+the number of start and end paragraph structures created here are equal and it will error if not.
+
+Nesting the activation and deactivation of the tagging of paragraphs can be quite difficult. For example if it is unclear if the inner code issues a |\par| or not it is not trivial to exclude an end hook for every excluded begin hook.
+In such cases it can be easier to use the new |paratag| key with the value |NonStruct| to convert some |P|-structures
+into |NonStruct|-structures without real meaning.
\subsection{Task 2: Marking the structure}
@@ -1296,16 +1312,29 @@ The key-val list understands the following keys:
Normally a new structure inserts itself as a kid into the currently active structure. This key prohibits this. The structure is nevertheless from now on \enquote{the current active structure} and parent for following marked content and structures.
\item[\PrintKeyName{label}]
- This key sets a label by which you can use the structure later in another structure. Internally the label name will start with \texttt{tagpdfstruct-}.
-
-
- \item[\PrintKeyName{alttext}]
- This key inserts an \texttt{/Alt} value in the dictionary of structure object, see section~\ref{sec:alttext}. The value is handled as verbatim string and hex encoded. The value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed). That means that you can do something like this:
+ This key sets a label by which one can refer to the structure. It is e.g.
+ used by \cs{tag\_struct\_use:n} (where a real label is actually not
+ needed as you can only use structures already defined), and by the
+ |ref| key (which can refer to future structures).
+ Internally the label name will start with \texttt{tagpdfstruct-} and it stores
+ the two attributes \texttt{tagstruct} (the structure number) and \texttt{tagstructobj} (the
+ object reference).
+
+ \item[\PrintKeyName{parent}]
+ % By default a structure is added as kid to the currently active structure.
+ With the parent key one can choose another parent. The value is a structure number which
+ must refer to an already existing, previously created structure. Such a structure
+ number can for example be have been stored with \cs{tag\_get:n}, but one can also use
+ a label on the parent structure and then use
+ \cs{ref\_value:nn}\verb+{tagpdfstruct-label}{tagstruct}+ to retrieve it.
+
+ \item[\PrintKeyName{alt}]
+ This key inserts an \texttt{/Alt} value in the dictionary of structure object, see section~\ref{sec:alt}. The value is handled as verbatim string and hex encoded. The value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed). That means that you can do something like this:
\begin{lstlisting}
\newcommand\myalttext{\frac{a}{b}}
- \tagstructbegin{tag=P,alttext=\myalttext}
+ \tagstructbegin{tag=P,alt=\myalttext}
\end{lstlisting}
@@ -1315,7 +1344,7 @@ The key-val list understands the following keys:
\item[\PrintKeyName{actualtext}]
- This key inserts an \texttt{/ActualText} value in the dictionary of structure object, see section~\ref{sec:alttext}. The value is handled as verbatim string, The value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed). That means that you can do something like this:
+ This key inserts an \texttt{/ActualText} value in the dictionary of structure object, see section~\ref{sec:alt}. The value is handled as verbatim string, The value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed). That means that you can do something like this:
\begin{lstlisting}
\newcommand\myactualtext{X}
@@ -1398,7 +1427,8 @@ The key-val list understands the following keys:
\item[\PrintKeyName{ref}]
This key allows to add references to other structure elements, it adds the |/Ref| array to the structure.
The value should be a comma separated list of structure labels set with the |label| key.
- e.g. |ref={label1,label2}|.
+ e.g. |ref={label1,label2}|. It can be used more than once in the key/value argument and combines the
+ references.
\item[\PrintKeyName{E}]
This key sets the |/E| key, the expanded form of an abbreviation or an acronym (I couldn't think of a better name, so I sticked to E).
@@ -1548,7 +1578,7 @@ The following shows the marking needed for a section, a sentence and a list with
\subsection{Lazy and automatic tagging}\label{sec:lazy}
-A number of features of \PDF{} readers need a fully tagged \PDF{}. As an example screen readers tend to ignore alternative text (see section~\ref{sec:alttext}) if the \PDF{} is not fully tagged. Also reflowing a \PDF{} only works for me (even if real space chars are in the \PDF{}) if the \PDF{} is fully tagged.
+A number of features of \PDF{} readers need a fully tagged \PDF{}. As an example screen readers tend to ignore alternative text (see section~\ref{sec:alt}) if the \PDF{} is not fully tagged. Also reflowing a \PDF{} only works for me (even if real space chars are in the \PDF{}) if the \PDF{} is fully tagged.
This means that even if you don't care about a proper structure you should try to add at least some minimal tagging. With pdflatex this is not easy due to the page break problem. But with lualatex you can use an \texttt{Document} structure and inside it rather large mc-chunks. This minimizes the needed work.
@@ -1576,7 +1606,7 @@ This is quite workable as long as you mark everything manually. But how to write
-\section{Alternative text, ActualText and text-to-speech software}\label{sec:alttext}
+\section{Alternative text, ActualText and text-to-speech software}\label{sec:alt}
@@ -1586,7 +1616,7 @@ Both can be added either to the marked content in the page stream or to the obje
The value of \PrintKeyName{/ActualText} (inserted by \texttt{tagpdf} with \PrintKeyName{actualtext}) is meant to replace single characters or rather small pieces of text. It can be used also without any tagging (e.g. with the package accsupp). If the \PDF{} reader support this (adobe reader does, sumatra not) one can change with it how a piece of text is copied and pasted e.g. to split up a ligature.
-\PrintKeyName{/Alt} (inserted by \texttt{tagpdf} with \PrintKeyName{alttext}) is a key to improve accessibility: with it one can add to a picture or something else an alternative text.
+\PrintKeyName{/Alt} (inserted by \texttt{tagpdf} with \PrintKeyName{alt}) is a key to improve accessibility: with it one can add to a picture or something else an alternative text.
The file \texttt{ex-alt-actualtext.tex} shows some experiments I made with with both keys and text-to-speech software (the in-built of adobe and nvda).
To sum them up:
@@ -1839,7 +1869,7 @@ This is not meant as a full reference only as a background to make the examples
\tagpdfparaOff
-\tagstructbegin{tag=Figure,alttext={Illustration of postfix notation},attribute=bbox}\tagmcbegin{tag=Figure}
+\tagstructbegin{tag=Figure,alt={Illustration of postfix notation},attribute=bbox}\tagmcbegin{tag=Figure}
\begin{tikzpicture}[baseline=(c.base)]
\node[arg](a1) {18};
\node[arg,right=of a1.east](a2) {0};
@@ -1912,7 +1942,7 @@ This is not meant as a full reference only as a background to make the examples
\tagpdfparaOff
- \tagstructbegin{tag=Figure,alttext={Illustration of array},attribute=bbox}\tagmcbegin{tag=Figure}
+ \tagstructbegin{tag=Figure,alt={Illustration of array},attribute=bbox}\tagmcbegin{tag=Figure}
\begin{tikzpicture}[baseline=(c.base)]
\node[arg](a1) {0};
\node[arg,right = of a1.east](a2) {15 0 R};
diff --git a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
index 677e2b5070..60aee8f364 100644
--- a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
+++ b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
@@ -1,5 +1,5 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2022-05-29} {0.95}
+\ProvidesExplPackage {tagpdfdocu-patches} {2022-08-06} {0.96}
{patches/commands for the tagpdf documentation}
\RequirePackage{etoolbox}