summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-12-19 03:00:50 +0000
committerNorbert Preining <norbert@preining.info>2023-12-19 03:00:50 +0000
commit60e9a31bad8271499f6b5f9280174e76bd62814f (patch)
treec33ee4a5f7e5fb95bab9a06c6a5121e1f4728db1 /macros/latex/contrib/tagpdf/tagpdf-struct.dtx
parente7154d152b4c047832de9bd4cf0d2bc3efe4125a (diff)
CTAN sync 202312190300
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-struct.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-struct.dtx85
1 files changed, 49 insertions, 36 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
index 9f839f8bc0..4808cccece 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
@@ -18,7 +18,7 @@
%
% The development version of the bundle can be found at
%
-% https://github.com/u-fischer/tagpdf
+% https://github.com/latex3/tagpdf
%
% for those people who are interested.
%<*driver>
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98q, released 2023-11-19}
+% \date{Version 0.98r, released 2023-12-18}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -175,7 +175,7 @@
% (I couldn't think of a better name, so I sticked to E).
% \end{function}
% \begin{function}{AF (struct-key),AFref (struct-key),
-% AFinline (struct-key),AFinline-o (struct-key),texsource}
+% AFinline (struct-key),AFinline-o (struct-key),texsource,mathml}
% \begin{syntax}
% AF = \meta{object name}\\
% AFref = \meta{object reference}\\
@@ -194,7 +194,12 @@
% still a research task to find out what is really needed.
%
% |texsource| is a special variant of |AF-inline-o| which embeds the file
-% as |.tex| source with the |/AFrelationship| key set to |/Source|.
+% as |.tex| source with the |/AFrelationship| key set to |/Source|. It also sets the |/Desc| key
+% to a (currently) fix text.
+%
+% |mathml| is a special variant of |AF-inline-o| which embeds the file
+% as |.xml| file with the |/AFrelationship| key set to |/Supplement|.
+% It also sets the |/Desc| key to a (currently) fix text.
%
% The argument of |AF| is an object name referring an embedded file as declared for example with
% \cs{pdf_object_new:n} or with the l3pdffile module. |AF| expands its argument
@@ -264,7 +269,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2023-11-19} {0.98q}
+\ProvidesExplPackage {tagpdf-struct-code} {2023-12-18} {0.98r}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -1225,25 +1230,28 @@
\cs_new_protected:Npn \@@_struct_add_inline_AF:nn #1 #2
% #1 content, #2 extension
{
- \group_begin:
- \int_gincr:N \g_@@_struct_AFobj_int
- \pdffile_embed_stream:neN
- {#1}
- {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2}
- \l_@@_tmpa_tl
- \@@_struct_add_AF:ee
- { \int_use:N \c@g_@@_struct_abs_int }
- { \l_@@_tmpa_tl }
- \@@_struct_prop_gput:nne
- { \int_use:N \c@g_@@_struct_abs_int }
- { AF }
- {
- [
- \tl_use:c
- { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl }
- ]
- }
- \group_end:
+ \tl_if_empty:nF{#1}
+ {
+ \group_begin:
+ \int_gincr:N \g_@@_struct_AFobj_int
+ \pdffile_embed_stream:neN
+ {#1}
+ {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2}
+ \l_@@_tmpa_tl
+ \@@_struct_add_AF:ee
+ { \int_use:N \c@g_@@_struct_abs_int }
+ { \l_@@_tmpa_tl }
+ \@@_struct_prop_gput:nne
+ { \int_use:N \c@g_@@_struct_abs_int }
+ { AF }
+ {
+ [
+ \tl_use:c
+ { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl }
+ ]
+ }
+ \group_end:
+ }
}
\cs_generate_variant:Nn \@@_struct_add_inline_AF:nn {on}
@@ -1293,16 +1301,19 @@
},
AFref .code:n = % AF property
{
- \@@_struct_add_AF:ee { \int_use:N \c@g_@@_struct_abs_int }{#1}
- \@@_struct_prop_gput:nne
- { \int_use:N \c@g_@@_struct_abs_int }
- { AF }
- {
- [
- \tl_use:c
- { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl }
- ]
- }
+ \tl_if_empty:eF {#1}
+ {
+ \@@_struct_add_AF:ee { \int_use:N \c@g_@@_struct_abs_int }{#1}
+ \@@_struct_prop_gput:nne
+ { \int_use:N \c@g_@@_struct_abs_int }
+ { AF }
+ {
+ [
+ \tl_use:c
+ { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl }
+ ]
+ }
+ }
},
,AFinline .code:n =
{
@@ -1315,6 +1326,7 @@
,texsource .code:n =
{
\group_begin:
+ \pdfdict_put:nnn { l_pdffile/Filespec } {Desc}{(TeX~source)}
\pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Source }
\@@_struct_add_inline_AF:on {#1}{tex}
\group_end:
@@ -1322,6 +1334,7 @@
,mathml .code:n =
{
\group_begin:
+ \pdfdict_put:nnn { l_pdffile/Filespec } {Desc}{(mathml~representation)}
\pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Supplement }
\@@_struct_add_inline_AF:on {#1}{xml}
\group_end:
@@ -1602,7 +1615,7 @@
\cs_set_protected:Npn \tag_struct_end:n #1
{
-%<debug>\@@_debug_struct_end_check:n{#1}
+%<debug> \@@_check_if_active_struct:T{\@@_debug_struct_end_check:n{#1}}
\tag_struct_end:
}
%</package|debug>
@@ -1850,7 +1863,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2023-11-19} {0.98q}
+\ProvidesExplPackage {tagpdf-attr-code} {2023-12-18} {0.98r}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}