summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-roles.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-roles.dtx40
1 files changed, 29 insertions, 11 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
index c700553f33..682c4e387a 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.98s, released 2024-01-19}
+% \date{Version 0.98t, released 2024-01-26}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -98,7 +98,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2024-01-19} {0.98s}
+\ProvidesExplPackage {tagpdf-roles-code} {2024-01-26} {0.98t}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
@@ -353,14 +353,14 @@
% \end{macrocode}
% \end{variable}
% Now we setup the standard names spaces.
-% The mathml space is currently only loaded for pdf 2.0.
+% The mathml space is loaded also for pdf < 2.0
+% but not added to RoleMap unless a boolean is set to true with
+% |tagpdf-setup{mathml-tags}|.
% \begin{macrocode}
+\bool_new:N \g_@@_role_add_mathml_bool
\@@_role_NS_new:nnn {pdf} {http://iso.org/pdf/ssn}{}
\@@_role_NS_new:nnn {pdf2} {http://iso.org/pdf2/ssn}{}
-\pdf_version_compare:NnF < {2.0}
- {
- \@@_role_NS_new:nnn {mathml}{http://www.w3.org/1998/Math/MathML}{}
- }
+\@@_role_NS_new:nnn {mathml}{http://www.w3.org/1998/Math/MathML}{}
\@@_role_NS_new:nnn {latex} {https://www.latex-project.org/ns/dflt/2022}{}
\@@_role_NS_new:nnn {latex-book} {https://www.latex-project.org/ns/book/2022}{}
\@@_role_NS_new:nnn {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
@@ -542,7 +542,25 @@
{
\prop_gput:cno { g_@@_role_NS_#2_prop } {#1}{\l_@@_tmpa_tl}
}
- }
+ }
+% \end{macrocode}
+% We also store into the pdf 1.7 rolemapping so that we can
+% add that as fallback for pdf 1.7 processor
+% \begin{macrocode}
+ \tl_if_empty:nF { #3 }
+ {
+ \tl_if_eq:nnF{#1}{#3}
+ {
+ \prop_get:NnN \g_@@_role_rolemap_prop {#3}\l_@@_tmpa_tl
+ \quark_if_no_value:NTF \l_@@_tmpa_tl
+ {
+ \prop_gput:Nne \g_@@_role_rolemap_prop {#1}{\tl_to_str:n{#3}}
+ }
+ {
+ \prop_gput:NnV \g_@@_role_rolemap_prop {#1}\l_@@_tmpa_tl
+ }
+ }
+ }
}
\cs_generate_variant:Nn \@@_role_add_tag:nnnn {VVVV}
% \end{macrocode}
@@ -697,8 +715,7 @@
% \begin{macrocode}
\@@_role_read_namespace:n {pdf}
\@@_role_read_namespace:n {pdf2}
-\pdf_version_compare:NnF < {2.0}
- {\@@_role_read_namespace:n {mathml}}
+\@@_role_read_namespace:n {mathml}
% \end{macrocode}
% in pdf 1.7 the following namespaces should only store
% the settings for later use:
@@ -1274,7 +1291,8 @@
\keys_define:nn { @@ / setup }
{
- add-new-tag .code:n =
+ mathml-tags .bool_gset:N = \g_@@_role_add_mathml_bool
+ ,add-new-tag .code:n =
{
\keys_set_known:nnnN
{@@/tag-role}