summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-user.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-user.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-user.dtx117
1 files changed, 77 insertions, 40 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-user.dtx b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
index 5f1a72a3e8..682708d4f9 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-user.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
@@ -2,7 +2,7 @@
%
%% File: tagpdf-user.dtx
%
-% Copyright (C) 2019-2023 Ulrike Fischer
+% Copyright (C) 2019-2024 Ulrike Fischer
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98r, released 2023-12-18}
+% \date{Version 0.98s, released 2024-01-19}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -120,7 +120,7 @@
% \cs{ShowTagging} \Arg{key-val}
% \end{syntax}
% This is a generic function to output various debugging helps. It not
-% necessarly stops the compilation. The keys and their function are described below.
+% necessarily stops the compilation. The keys and their function are described below.
% \end{function}
%
% \begin{function}{mc-data (show-key)}
@@ -158,6 +158,15 @@
% If no value is used, then the default is |show|.
% \end{function}
%
+% \begin{function}{debug/structures (show-key)}
+% \begin{syntax}
+% |debug/structures| = \meta{structure number}
+% \end{syntax}
+% This key is available only if the tagpdf-debug package is loaded
+% and shows all structures starting with the one with the number
+% given by the key.
+% \end{function}
+
% \section{Extension commands}
% The following commands and code parts are not core commands of tagpdf.
% They either provide work-arounds for missing functionality elsewhere,
@@ -243,6 +252,50 @@
% { Contents }
% { (ref) }
% \end{verbatim}
+%
+% \section{Socket support}
+%
+% \begin{function}{\tag_socket_use:n,\tag_socket_use:nn,\UseTaggingSocket}
+% \begin{syntax}
+% \cs{tag_socket_use:n} \Arg{socket name}\\
+% \cs{tag_socket_use:nn} \Arg{socket name} \Arg{socket argument}\\
+% \cs{UseTaggingSocket} \Arg{socket name} \\
+% \cs{UseTaggingSocket} \Arg{socket name} \Arg{socket argument}\\
+% \end{syntax}
+% \end{function}
+
+% The next \LaTeX{} will use special sockets for the tagging.
+%
+% These sockets will use names starting
+% with \texttt{tagsupport/}. Usually, these sockets have exactly two
+% plugs defined: \texttt{noop} (when no tagging is requested or
+% tagging is not wanted for some reason) and
+% a second plug that enables the tagging. There
+% may be more, e.g., tagging with special debugging, etc., but right
+% now it is usually just on or off.
+%
+% Given that we sometimes have to suspend tagging, it would be fairly
+% inefficient to put different plugs into these sockets whenever that
+% happens. We therefore offer \cs{UseTaggingSocket} which is like
+% \cs{UseSocket} except that the socket name is specified without
+% \texttt{tagsupport/}, i.e.,
+% \begin{quote}
+% \verb=\UseTaggingSocket{foo}= $\to$
+% \verb=\UseSocket{tagsupport/foo}=
+% \end{quote}
+% Beside being slightly shorter, the big advantage is that this way
+% we can change \cs{UseTaggingSocket} to do nothing by switching a boolean
+% instead of changing the plugs of the tagging support sockets back and forth.
+%
+% It is possible to use the tagging support sockets with
+% \cs{UseSocket} directly, but in this case the socket remains active
+% if e.g. \cs{SuspendTagging} is in force. There may be reasons for doing
+% that but in general we expect to always use \cs{UseTaggingSocket}.
+%
+% The L3 programming layer versions \cs{tag_socket_use:n} and
+% \cs{tag_socket_use:nn} are slightly more efficient than
+% \cs{UseTaggingSocket} because they do not have to determine how
+% many arguments the socket takes when disabling it.
% \end{documentation}
%
% \begin{implementation}
@@ -250,7 +303,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2023-12-18} {0.98r}
+\ProvidesExplPackage {tagpdf-user} {2024-01-19} {0.98s}
{tagpdf - user commands}
%</header>
% \end{macrocode}
@@ -347,39 +400,6 @@
% \end{macro}
%
% \section{Socket support}
-% The next \LaTeX{} will use special sockets for the tagging.
-%
-% These sockets will use names starting
-% with \texttt{tagsupport/}. Usually, these sockets have exactly two
-% plugs defined: \texttt{noop} (when no tagging is requested or
-% tagging is not wanted for some reason) and
-% a second plug that enables the tagging. There
-% may be more, e.g., tagging with special debugging, etc., but right
-% now it is usually just on or off.
-%
-% Given that we sometimes have to suspend tagging, it would be fairly
-% inefficient to put different plugs into these sockets whenever that
-% happens. We therefore offer \cs{UseTaggingSocket} which is like
-% \cs{UseSocket} except that the socket name is specified without
-% \texttt{tagsupport/}, i.e.,
-% \begin{quote}
-% \verb=\UseTaggingSocket{foo}= $\to$
-% \verb=\UseSocket{tagsupport/foo}=
-% \end{quote}
-% Beside being slightly shorter, the big advantage is that this way
-% we can change \cs{UseTaggingSocket} to do nothing by switching a boolean
-% instead of changing the plugs of the tagging support sockets back and forth.
-%
-% It is possible to use the tagging support sockets with
-% \cs{UseSocket} directly, but in this case the socket remains active
-% if e.g. \cs{SuspendTagging} is in force. There may be reasons for doing
-% that but in general we expect to always use \cs{UseTaggingSocket}.
-%
-% The L3 programming layer versions \cs{tag_socket_use:n} and
-% \cs{tag_socket_use:nn} are slightly more efficient than
-% \cs{UseTaggingSocket} because they do not have to determine how
-% many arguments the socket takes when disabling it.
-%
% Until we can be sure that the kernel defines the commands we provide them before
% redefining them:
% \begin{macrocode}
@@ -718,7 +738,10 @@
% \g_@@_para_main_end_int,
% \l_@@_para_tag_default_tl,
% \l_@@_para_tag_tl,
-% \l_@@_para_main_tag_tl}
+% \l_@@_para_main_tag_tl,
+% \l_@@_para_attr_class_tl,
+% \l_@@_para_main_attr_class_tl,
+% }
% At first some variables.
% \begin{macrocode}
%</package>
@@ -736,6 +759,12 @@
\tl_new:N \l_@@_para_main_tag_tl
\tl_set:Nn \l_@@_para_main_tag_tl {text-unit}
% \end{macrocode}
+% this is perhaps already defined by the block code
+% \begin{macrocode}
+\tl_if_exist:NF \l_@@_para_attr_class_tl
+ {\tl_new:N \l_@@_para_attr_class_tl }
+\tl_new:N \l_@@_para_main_attr_class_tl
+% \end{macrocode}
% \end{macro}
% \begin{macro}
@@ -827,6 +856,10 @@
% \begin{macrocode}
\AddToHook{package/latex-lab-testphase-block/after}
{
+ \tl_if_exist:NT \l_tag_para_attr_class_tl
+ {
+ \tl_set:Nn \l_@@_para_attr_class_tl { \l_tag_para_attr_class_tl }
+ }
\cs_set_protected:Npn \__block_start_para_structure:n #1 {
\__block_debug_typeout:n
{ @endpe = \legacy_if:nTF { @endpe }{true}{false}
@@ -836,7 +869,11 @@
\bool_if:NF \l__tag_para_flattened_bool
{
\@@_gincr_para_main_begin_int:
- \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
+ \tag_struct_begin:n
+ {
+ tag=\l_@@_para_main_tag_tl,
+ attribute-class=\l_@@_para_main_attr_class_tl,
+ }
}
}
\@@_gincr_para_begin_int:
@@ -844,7 +881,7 @@
\tag_struct_begin:n
{
tag=\l__tag_para_tag_tl
- ,attribute-class=\l_tag_para_attr_class_tl
+ ,attribute-class=\l_@@_para_attr_class_tl
}
\__tag_check_para_begin_show:nn {green}{#1}
\tag_mc_begin:n {}