summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty50
1 files changed, 44 insertions, 6 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
index ec5042709a..93290cea0e 100644
--- a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
+++ b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
@@ -1,6 +1,40 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2021-06-14} {0.82}
+\ProvidesExplPackage {tagpdfdocu-patches} {2021-06-29} {0.9}
{patches/commands for the tagpdf documentation}
+\RequirePackage{etoolbox}
+%%%%
+% header and footer (now needed as attributes are global again)
+%%%%
+%% patching \@oddfoot/\@oddhead is nonsense, that is redefined all the time.
+%% Using the scrlayer interfaces would probably work
+%% but we will need a core latex solution anyway
+%% so let's test it here and patch \@outputpage
+%% we also disable paratagging, not for the tagging but to avoid that the small
+%% numbers gives overfull vbox messages ...
+\patchcmd\@outputpage
+ {\hb@xt@\textwidth{\@thehead}}
+ {
+ \hb@xt@\textwidth
+ {
+ \bool_set_false:N \l__tag_para_bool
+ \tag_mc_artifact_group_begin:n{pagination}
+ \@thehead
+ \tag_mc_artifact_group_end:
+ }
+ }
+ {}{\fail}
+\patchcmd\@outputpage
+ {\hb@xt@\textwidth{\@thefoot}}
+ {
+ \hb@xt@\textwidth
+ {
+ \bool_set_false:N \l__tag_para_bool
+ \tag_mc_artifact_group_begin:n{pagination}
+ \@thefoot
+ \tag_mc_artifact_group_end:
+ }
+ }
+ {}{\fail}
%%%%%
% tableofcontents
@@ -40,10 +74,10 @@
pagenumberformat=\tagscrtocpagenumber]{tocline}{paragraph}
-
+% \IfStr{#3} doesnt like a \label ...
\renewcommand{\addtocentrydefault}[3]{%
- \Ifstr{#3}{}{}
- {%\
+% \Ifstr{#3}{}{}
+% {%
\Ifstr{#2}{}
{%
\addcontentsline{toc}{#1}
@@ -69,7 +103,8 @@
\tagstructend
}%
}%
- }}%
+ %}
+}%
% the dots must be marked too
@@ -185,7 +220,10 @@
% but currently unneeded as we marked them up as artifacts anyway as they don't contain
% meaningful contents
-\NewDocumentCommand\sidenote{m}{\begin{tagmcartifact}{notype}\tagpdfparaOff\marginnote{#1}\end{tagmcartifact}}
+\NewDocumentCommand\sidenote{m}
+ {
+ \tag_mc_artifact_group_begin:n{notype}\tagpdfparaOff\marginnote{#1}\tag_mc_artifact_group_end:
+ }
% ======== tikzpicture ==========
% TODO this needs some investigation: it messes up the stack if one add paraOff